[英]In Android how do I change the default application for a particular intent programmatically?
我正在编写一个具有以下功能的Android应用程序:运行/启动该应用程序时,它应该是一种特定意图的默认意图处理程序,而当该应用程序未运行时,应启动系统的默认应用程序...
Fortunately, this is not possible, for obvious security reasons. 幸运的是,出于明显的安全原因,这是不可能的。
You are welcome to enable and disable the activity that contains your specific <intent-filter>
, using PackageManager
and queryIntentActivities()
. 欢迎您使用
PackageManager
和queryIntentActivities()
启用和禁用包含特定<intent-filter>
的活动。 However, you cannot make it be the default handler. 但是,您不能使其成为默认处理程序。 The user will be presented with a chooser dialog and will be able to make their choice.
将向用户显示一个选择器对话框,并且可以进行选择。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.