您的位置:首页 > 移动开发

android 跳转当前app权限页面

2017-10-03 19:09 246 查看
来源:

https://stackoverflow.com/questions/32898901/go-to-my-apps-app-permission-screen#

两种代码,经测试

都是成功的。

Go to My app’s App Permission screen

跳转 当前 app 权限页面

问答中,给出了如何跳转到当前app 详细信息界面的跳转代码,

进而,设置权限。

代码1

FLAG_ACTIVITY_NEW_TASK

https://developer.android.google.cn/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK

官方链接,可直接访问

Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", getPackageName(), null));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 有无均可
startActivity(intent);


代码2

startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + BuildConfig.APPLICATION_ID)));


另外的:

https://stackoverflow.com/questions/32822101/how-to-programmatically-open-the-permission-screen-for-a-specific-app-on-android#

这篇问答,讨论了,

如何在android 6.0 之上的系统,

直接打开app permissions 界面

好像,没有结论。。。。。。。。

other:

application_id 和 packagename有区别吗?

end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐