Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 当设备接收到来自服务器的通知时,状态栏上显示的图标?_Android_Notifications_Google Cloud Messaging_Uistatusbar - Fatal编程技术网

Android 当设备接收到来自服务器的通知时,状态栏上显示的图标?

Android 当设备接收到来自服务器的通知时,状态栏上显示的图标?,android,notifications,google-cloud-messaging,uistatusbar,Android,Notifications,Google Cloud Messaging,Uistatusbar,处理应用程序时,我在设备中接收通知 我已经使用下面的code.setSmallIcon(drawableicon)为代码中的通知设置了图形图标 NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(this); notifBuilder.setSmallIcon(drawableicon); notifBuilder.setTicker(ticker); noti

处理应用程序时,我在设备中接收通知

我已经使用下面的code.setSmallIcon(drawableicon)为代码中的通知设置了图形图标

NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(this);
       notifBuilder.setSmallIcon(drawableicon);
       notifBuilder.setTicker(ticker);
       notifBuilder.setContentTitle(title);
       notifBuilder.setContentText(text);
      // notifBuilder.setLargeIcon(((BitmapDrawable)getResources().getDrawable(R.drawable.gift_candy_left)).getBitmap());
       notifBuilder.setContentIntent(contentIntent); 

       if(!isAppForground())  {
           Uri notificationSound =Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.qubodup_popup);                
           notifBuilder.setSound(notificationSound);
       }


       NotificationManager notifManager = (NotificationManager)this.getSystemService(
               Context.NOTIFICATION_SERVICE);


       notifManager.notify(notifId, notifBuilder.build());
当设备接收到通知时,状态栏中的通知图标不合适

当我拉下通知面板时,图标非常适合


请建议我,如何在设备收到通知时,在状态栏上显示通知图标

检查图标的大小。应为此处提到的24dp:请参见