0
我創造了一個Notification
Activity
(例如text.class
),當主動說和我Click on it
,還給我在頁面(text.class
)在此頁面中我有一個TimerTask
,我需要的是,當Click on that Notification Reset page
或Finish() the TimerTask
。點擊通知,然後完成TimerTask?
我該怎麼做?
我以爲當我click on notification
reset page
和finish TimerTask
。
這是我Notification
:
NotificationManager nman;
nman=(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Long when=System.currentTimeMillis();
Notification n;
n=new Notification(R.drawable.chat_logo,"",when);
Context context=getApplicationContext();
String Title=G.context.getResources().getString(R.string.StatusM);
String Text=G.context.getResources().getString(R.string.Statusms);
Intent notifintent=new Intent(context,ConversationPage.class);
PendingIntent pending;
pending=PendingIntent.getActivity(context,0,notifintent,android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
n.setLatestEventInfo(context, Title, Text, pending);
n.flags = Notification.FLAG_AUTO_CANCEL;
nman.notify(0,n);