【发布时间】:2015-04-22 14:01:00
【问题描述】:
如何在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 。你能开始接受你的问题的答案吗?
标签: android notifications push-notification android-notifications