前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Start InstalledAppDetails Activity With a Specific Package Name

Start InstalledAppDetails Activity With a Specific Package Name

作者头像
技术小黑屋
发布2018-09-04 16:29:28
5660
发布2018-09-04 16:29:28
举报
文章被收录于专栏:技术小黑屋技术小黑屋

This trick works. It’s really easy.

1 2 3

//Let take com.mx.browser as the package name Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:com.mx.browser")); startActivity(intent);

Here is the javadoc of android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS

Activity Action: Show screen of details about a particular application. In some cases, a matching Activity may not exist, so ensure you safeguard against this. Input: The Intent’s data URI specifies the application package name to be shown, with the “package” scheme. That is “package:com.my.app”. Output: Nothing.

A glance at how InstalledAppDetails get packageName

1 2 3 4 5 6 7 8 9

final Bundle args = getArguments(); String packageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null; if (packageName == null) { Intent intent = (args == null) ? getActivity().getIntent() : (Intent) args.getParcelable("intent"); if (intent != null) { packageName = intent.getData().getSchemeSpecificPart(); } }

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档