PendingIntent概述

PendingIntent概述

一,區(qū)別

1,PendingIntent一般用于跳到應(yīng)用內(nèi)部,Intent一般跳轉(zhuǎn)到指定的activity,service等?

二,支持三種待定意圖:

1,getActivity(Contextcontext,int requestCode,Intent intent,int flags);

2,getService(Contextcontext,int requestCode,Intent intent,int flags);

3,getBroadcast(Contextcontext,int requestCode,Intent intent,int flags);?

三,說明事項

1,requestCode一般為0即可

2,flags有四種:

A,flag_one_shot,同類的通知只能使用一次,后續(xù)的通知單機將無法打開

B,flag_no_create ,這個標(biāo)記位很少見,它無法單獨會用,因此在日常開發(fā)中用的很少

C,flag_cancel_current ,被cancel的消息單機后將無法打開

D,flag_update_current,執(zhí)行更新,他們的intent中的Extras會被替代成最新的


?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容