1
的Android如何將數據傳遞到多個通知,明確當點擊它
多個數據傳遞到通知 當我通知點擊它只能打開最近
final Notification notifyDetails = new Notification(R.drawable.e4,"temp",System.currentTimeMillis());
long[] vibrate = {100,100,200,300};
notifyDetails.vibrate = vibrate;
notifyDetails.defaults =Notification.DEFAULT_ALL;
Context context = getApplicationContext();
CharSequence contentTitle = "hello"
CharSequence contentText = "You have a notification" ;
Intent notifyIntent = new Intent(context, Send_Notification_Act.class);
notifyIntent.putExtra("name", "sunil");
notifyIntent.putExtra("ID", SIMPLE_NOTFICATION_ID);
PendingIntent intent =
PendingIntent.getActivity(Back_Reciver.this, 0,
notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);