小编Tod*_*oda的帖子

通知中的setgroup()不起作用

我想创建通知组,这是我的代码:

 // 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)

当我运行应用程序并发送通知消息时,它们不会显示在组中.有人可以解释一下我需要改变什么吗?

notifications android

12
推荐指数
2
解决办法
8300
查看次数

为什么我收到错误 ClassNotFoundException: com.amazonaws.auth.AWSCredentialsProvider?

我安装了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)

有人可以解释为什么会发生此异常吗?

java amazon-s3

6
推荐指数
1
解决办法
3138
查看次数

如何在用户通过身份验证之前编辑“AWS cognito”用户池中用户的电话号码?

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)

android amazon-web-services

6
推荐指数
1
解决办法
4119
查看次数