Android中的PendingIntent 原理

pendingIntent他封裝了一個intent,這個intent不會立即執行,當滿足一定條件的時候才執行intent,

比如notification 當用戶點擊了通知欄的notification的時候纔會跳轉到,應用的某一個activity,

因爲你得到pendingIntent的方法是getbroadcast()所以這個pendIntent點擊以後會發送一條廣播,

getActivity()這個的話會啓動一個activity;getService()會啓動一個service

發佈了24 篇原創文章 · 獲贊 11 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章