什么是一个Android PendingIntent? [英] What is an Android PendingIntent?

查看:163
本文介绍了什么是一个Android PendingIntent?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手到Android。我读了Android的文档,但我还是需要一些更多的澄清。谁能告诉我,究竟一个 PendingIntent 是?

I am a newbie to Android. I read the Android Documentation but I still need some more clarification. Can anyone tell me what exactly a PendingIntent is?

推荐答案

A PendingIntent 是给外国申请一个标记(如 NotificationManager AlarmManager ,主屏幕 AppWidgetManager 或其他第三方应用程序),其中< STRONG>允许外国申请使用应用程序的权限执行predefined一张code

A PendingIntent is a token that you give to a foreign application (e.g. NotificationManager, AlarmManager, Home Screen AppWidgetManager, or other 3rd party applications), which allows the foreign application to use your application's permissions to execute a predefined piece of code.

如果你给了外国申请的意图,并且应用程序发送/广播意图你给了,他们将执行意图用自己的权限。但如果你给外国申请一个 PendingIntent 您使用自己的权限创建的,该应用程序将执行包含意图使用你的应用程序的许可。

If you give the foreign application an Intent, and that application sends/broadcasts the Intent you gave, they will execute the Intent with their own permissions. But if you instead give the foreign application a PendingIntent you created using your own permission, that application will execute the contained Intent using your application's permission.

这篇关于什么是一个Android PendingIntent?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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