0
我从我的服务器上正确接收推送通知,但条形图中的showen图标与图标的应用程序不同,我不知道这是哪里来的。推送通知图标GCM
这是我的代码:
private void sendNotification(String msg, String page_id) {
mNotificationManager = (NotificationManager)
this.getSystemService(Context.NOTIFICATION_SERVICE);
Intent intent = new Intent(this, SplashActivity.class);
Bundle bundle = new Bundle();
bundle.putString("page_id", page_id);
intent.putExtras(bundle);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
intent , PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this).setAutoCancel(false)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(getResources().getString(R.string.app_name))
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(msg))
.setContentText(msg);
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
}
应用程序的图标:
- RES /提拉 - 华电国际大小:最高72x72
- RES /绘制-LDPI尺寸:最高72x72
- 资源/ drawable-mdpi size:48x48
- res/drawable-xhdpi size:96x6
- RES /绘制-xxhdpi尺寸144x144
显示的图标是什么?一个白色的广场? –
从另一个应用程序没有图标,即使我删除它 – Euphor08
'R.drawable.ic_launcher'这应该出现。如果你没有改变你的应用程序图标,它应该是Android的绿色头。 –