2012-07-07 20 views

回答

0

你必須與PendingIntent創建通知。從Android Developers

Context context = getApplicationContext(); 
CharSequence contentTitle = "My notification"; 
CharSequence contentText = "Hello World!"; 
Intent notificationIntent = new Intent(this, MyClass.class); 
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); 

notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); 

private static final int HELLO_ID = 1; 
mNotificationManager.notify(HELLO_ID, notification); 

哪裏MyClass是你想從通知開始活動。

相關問題