Open Default Browser Settings page programmatically

淺唱寂寞╮ 提交于 2019-12-25 16:53:31

问题


Is there a way to open the settings page of the default browser for Android programmatically from an application?

Through some intent? or Maybe some other way to do it?


回答1:


Yes, we can use this code for call Browser settings page from our application

 Intent i = new Intent(Intent.ACTION_MANAGE_NETWORK_USAGE);
// It launches Chooser without specify the package name becz ACTION_MANAGE_NETWORK_USUAGE  // action is used in Other apps also.
 i.setPackage("com.android.browser");
 startActivity(i);

Note: it supports from APi14 why this means that Settings page is not accessible from outside of Browser .From Api14 they provide intent-action for this.based on this action we can access it from outside



来源:https://stackoverflow.com/questions/21297492/open-default-browser-settings-page-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!