如何在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());
Run Code Online (Sandbox Code Playgroud) notifications android push-notification android-notifications