閱讀569 返回首頁    go 阿裏雲 go 技術社區[雲棲]


setLatestEventInfo

Notification notification = new Notificatio(drawable,tickerText,System.currentTimeMillis()); //此處定義了一個Notification ,其中第一個參數代表圖標第二個參數代表提示的內容,第三個參數是指要顯示的時間,一般是當即顯示,故填入係統當前時間。 PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, ActivityMain.class), 0);//該語句的作用是定義了一個不是當即顯示的activity,隻有當用戶拉下notify顯示列表,並且單擊對應的項的時候,才會觸發係統跳轉到該activity. notification.setLatestEventInfo(this, title, content, contentIntent);//在此處設置在nority列表裏的該norifycation得顯示情況。 mNotificationManager.notify(NOTIFICATIONS_ID, notification);

最後更新:2017-04-02 06:51:50

  上一篇:go SSH整合學習筆記之struts2+spring+hibernate+c3p0
  下一篇:go Android Jni調用so庫,加載庫失敗分析