如何在android中的通知区域添加通知图标? 我试试这个,但是这在通知区域显示一个空白的空白。推送通知图标Android
mNotificationManager = (NotificationManager) this
.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, Receive_Message_list.class), 0);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this)
.setSmallIcon(R.drawable.pushicon)
.setContentTitle("MAY-I")
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(notification_message))
.setContentText(notification_message);
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
可以共享通知的截图..代码似乎很好..也有没有在logcat的错误? –
logcat不显示任何错误。但状态栏显示一个空白的白色图标来代替应用程序图标 –
@RahilAli。你能开始接受你的问题的答案吗? – petey