了解Android中的粘性意图 [英] Knowing about Sticky intent in Android

查看:81
本文介绍了了解Android中的粘性意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在android中,有3种Intent,

In android there are 3 kinds of Intents,

  1. 意图,
  2. 粘性意图,
  3. 待定意图.

那么粘性意图是什么?

推荐答案

意图-是Android组件之间(内容提供者除外)之间的消息传递机制.您可以使用Intent启动任何 组件.

Intent - is a message passing mechanism between components of Android, except for Content Provider. You can use Intent to start any component.

粘性意图-坚持使用Android,供以后的广播收听者使用.例如,如果发生BATTERY_LOW事件,则该Intent 将继续使用Android,以便将来对 BATTERY_LOW,将返回Intent.

Sticky Intent - Sticks with Android, for future broadcast listeners. For example if BATTERY_LOW event occurs then that Intent will stick with Android so that any future requests for BATTERY_LOW, will return the Intent.

待定意向-如果您希望某人在将来的某个时间点代表您执行任何意向操作,那么我们将使用 待定意图.

Pending Intent - If you want some one to perform any Intent operation at future point of time on behalf of you, then we will use Pending Intent.

这篇关于了解Android中的粘性意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆