1.在Notification裏面定義一個值android
Intent intent = new Intent(MainActivity.this, NotifyActivity.class);this
PendingIntent pi = PendingIntent.getActivity(MainActivity.this, 0, intent, 0);
Bundle bundle = new Bundle();
bundle.putString("id","123456");
intent.putExtras(bundle);
Notification notify = new Notification();
notify.icon = R.drawable.ico_dog;
notify.tickerText = title;
notify.when = System.currentTimeMillis();
notify.defaults = Notification.DEFAULT_SOUND;
notify.setLatestEventInfo(MainActivity.this, "最新通知", title, pi);
notify.vibrate = new long[]{0, 50, 100, 150};
notify.contentIntent = pi;
notify.flags = Notification.FLAG_AUTO_CANCEL;
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
spa
nm.notify(0x1123, notify);.net
在NotifyActivity裏面這樣寫獲取的id的值爲NULL 是爲何orm
Intent intent = getIntent();
Bundle data = intent.getExtras();
String id = data.getString("id");排序
求解!!!!!!!!get
zilei
it
標籤: Androidio