当用户单击通知时,我有一个GCMIntentService
我正在为意图和所有设置详细信息的位置。我与此相关的代码片段如下:
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Intent notificationIntent = new Intent(context, CustomTabActivity.class);
if (noteId != null && value != null) {
notificationIntent.putExtra("noteId", noteId);
notificationIntent.putExtra("value", value);
}
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification updateComplete = new NotificationCompat.Builder(context)
.setContentTitle(title)
.setContentText(msg)
.setTicker(title)
.setWhen(System.currentTimeMillis())
.setContentIntent(contentIntent)
.setDefaults(Notification.DEFAULT_SOUND)
.setAutoCancel(true)
.setSmallIcon(R.drawable.icon)
.build();
notificationManager.notify(100, updateComplete);
无论何时CustomTabActivity.class
打开,getExtras()
调用始终为空。为什么我无法从意图中获取值?
我为此阅读了以下内容,但无法解决: