美文网首页
PendingIntent概述

PendingIntent概述

作者: 小毕_先生 | 来源:发表于2018-01-05 15:26 被阅读0次

PendingIntent概述

一,区别

1,PendingIntent一般用于跳到应用内部,Intent一般跳转到指定的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,同类的通知只能使用一次,后续的通知单机将无法打开

B,flag_no_create ,这个标记位很少见,它无法单独会用,因此在日常开发中用的很少

C,flag_cancel_current ,被cancel的消息单机后将无法打开

D,flag_update_current,执行更新,他们的intent中的Extras会被替代成最新的

相关文章

网友评论

      本文标题:PendingIntent概述

      本文链接:https://www.haomeiwen.com/subject/zkcyxxtx.html