Notification中怎麼傳值給下一個Activity

Java code?android

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
 
                     Notification notification =  new  Notification(
                             android.R.drawable.stat_notify_chat,  "Hello" ,
                             System.currentTimeMillis());
 
                     Intent notificationIntent =  new  Intent(MyNotification. this ,
                             SendActivity. class );
 
                     System.out.println( "xy=" +xy);
                     
                         notificationIntent.putExtra( "xy" , xy);
                     
                     PendingIntent pIntent = PendingIntent.getActivity(
                             MyNotification. this 0 , notificationIntent,  0 );
                     notification.setLatestEventInfo(MyNotification. this ,
                             contentTitle, contentText +  "**"  + str, pIntent);
 
                     System.out.println( "Handler  id="  + MyNotification.ID);
                     notificationManager.notify(MyNotification.ID, notification);



Activity中的代碼

Intent intent=getIntent();

int kk=intent.getIntExtra("xy", 0);post



#1 得分:40回覆於: 2012-08-20 17:04:58this

這樣

PendingIntent pendingIntent = PendingIntent.getActivity(this, id, intent, PendingIntent.FLAG_UPDATE_CURRENT);spa

若是您對CSDN論壇有意見和建議 請直接在本帖指教.net

對我有用[1] 丟個板磚[0] 引用 | 舉報 管理code

相關文章
相關標籤/搜索