我在将数据放入意图和读取数据之间存在数据不匹配的问题。在我的服务中,我正在创建通知并向意图添加参数。当我看到通知时,参数没问题。但是当我打开通知时,参数行为是有线的。我在我的系统中获得了真实的参数,但一旦我发送就没有。这个问题是因为我在我的服务中创建通知吗?
public void createNotification(ChatMessage message)
{
Notification notification = new Notification(R.drawable.ic_action_sm,
"Message From" +
" " + message.getSenderName(),
System.currentTimeMillis());
notification.flags |= Notification.FLAG_AUTO_CANCEL;
Intent intent = new Intent(this, ChatActivity.class);
intent.putExtra("userProfile", message.getReciverChatProfile());
intent.putExtra("friendProfile", message.getSenderChatProfile());
PendingIntent activity = PendingIntent.getActivity(this, 0, intent, 0);
notification.setLatestEventInfo(this,
message.getSenderName(),
message.getMessage(),
activity);
notification.number += 1;
notification.iconLevel = 3;
notificationManager.notify(0, notification);
}