我使用這些代碼行在我的應用程序中顯示通知,但索尼設備(xperia p,sola,acro s)不顯示任何通知。我沒有任何其他的Android設備的問題。通知:索尼設備不顯示任何通知
Intent notificationIntent = new Intent(context, ActivityShowQuestion.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent contentIntent = PendingIntent.getActivity(context,
Integer.parseInt(id), notificationIntent,
PendingIntent.FLAG_ONE_SHOT);
NotificationManager nm = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
Notification.Builder builder = new Notification.Builder(context);
builder.setContentIntent(contentIntent)
.setSmallIcon(R.drawable.ic_launcher)
.setWhen(System.currentTimeMillis())
.setAutoCancel(true)
.setContentTitle("title")
.setContentText("text");
Notification n = builder.build();
nm.notify(id, n);
我使用Google搜索,但找不到任何答案。
我有第一個體驗和即時通訊與代碼即時通訊使用,它有點不同,要我發佈 – JRowan 2013-05-01 08:40:15
是的謝謝,如果有可能 – 2013-05-01 08:42:32