我想创建通知组,这是我的代码:
// Build the notification, setting the group appropriately
Notification notif = new NotificationCompat.Builder(getApplicationContext())
.setContentTitle("New mail from " + 1)
.setContentText("cv")
.setSmallIcon(R.drawable.rh_logo)
.setStyle(new NotificationCompat.InboxStyle()
.addLine("Alex Faaborg Check this out")
.addLine("Jeff Chang Launch Party")
.setBigContentTitle("2 new messages")
.setSummaryText("johndoe@gmail.com"))
.setGroup(GROUP_KEY_EMAILS)
.setGroupSummary(true)
.build();
// Issue the notification
NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(++NOTIFICATION_ID, notif);
Run Code Online (Sandbox Code Playgroud)
当我运行应用程序并发送通知消息时,它们不会显示在组中.有人可以解释一下我需要改变什么吗?
我安装了AWS toolkitfor java 并将其连接到我在 buildpath 中的项目,我尝试将文件上传到S3.
File fileOfImages = new File("/sdcard/Save Image Tutorial");
AmazonS3 s3client = new AmazonS3Client(new ProfileCredentialsProvider());
s3client.putObject(new PutObjectRequest("rosh-haayin-images", "images",fileOfImages));
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
ClassNotFoundException: com.amazonaws.auth.AWSCredentialsProvider
Run Code Online (Sandbox Code Playgroud)
有人可以解释为什么会发生此异常吗?
我AWS cognito用来验证用户的电话号码。我有一个问题:当用户输入他的详细信息时,我将其发送到 AWS。AWS 尝试向用户的电话号码发送代码,但如果用户输入了错误的号码,AWS 将返回异常“电话号码无效”。所以我要求用户更新号码,但是当我尝试在 AWS 中更新它时,他们返回exception“用户未经过身份验证”。用户刚刚注册但仍未确认后,如何将号码更新为正确的号码?这是我的代码:
// Create a CognitoUserAttributes object and add user attributes
CognitoUserAttributes userAttributes = new CognitoUserAttributes();
// Add the user attributes. Attributes are added as key-value pairs
// Adding user's given name.
// Note that the key is "given_name" which is the OIDC claim for given name
userAttributes.addAttribute("name", userName);
userAttributes.addAttribute("family_name", userFamily);
// Adding user's phone number
userAttributes.addAttribute("phone_number", prepareValidPhoneNumberForAWS(userPhone));
SignUpHandler signupCallback = new SignUpHandler()
{
int t=0;
@Override
public void …Run Code Online (Sandbox Code Playgroud)