Android 中的 "foreign application" 是什么?
What is a "foreign application" in Android?
在 http://developer.android.com/guide/components/intents-filters.html 我读到:
A PendingIntent object is a wrapper around an Intent object. The primary purpose of a PendingIntent is to grant permission to a foreign application to use the contained Intent as if it were executed from your app's own process.
我可能会做出一些猜测,但外国申请到底是什么?
外国或第三方应用程序是除创建 PendingIntent
的应用程序之外的任何应用程序。
任何其目的和服务与另一个应用程序不同的应用程序都是外国应用程序。例如,Viber 是 Whatsapp 的外国应用程序。
在此 android:
中使用 pendentIndent
Pending Intent:
It is a token that you give to a foreign application which allows the foreign application to use your application’s permissions to execute a predefined piece of code. In our android widget example, foreign application is nothing but Home Screen AppWidgetManager and the code to be executed is the Intent that will open messaging app.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("sms:"));
PendingIntent pending = PendingIntent.getActivity(context, 0,intent, 0);
在 http://developer.android.com/guide/components/intents-filters.html 我读到:
A PendingIntent object is a wrapper around an Intent object. The primary purpose of a PendingIntent is to grant permission to a foreign application to use the contained Intent as if it were executed from your app's own process.
我可能会做出一些猜测,但外国申请到底是什么?
外国或第三方应用程序是除创建 PendingIntent
的应用程序之外的任何应用程序。
任何其目的和服务与另一个应用程序不同的应用程序都是外国应用程序。例如,Viber 是 Whatsapp 的外国应用程序。
在此 android:
中使用 pendentIndentPending Intent:
It is a token that you give to a foreign application which allows the foreign application to use your application’s permissions to execute a predefined piece of code. In our android widget example, foreign application is nothing but Home Screen AppWidgetManager and the code to be executed is the Intent that will open messaging app.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("sms:"));
PendingIntent pending = PendingIntent.getActivity(context, 0,intent, 0);