简体   繁体   中英

How to open Default Browser settings from my android application?

As per my requirement I have to clear default browser cache from my application. I want to open browser settings from my application, so that user can clear the cache. By using following code.

startActivityForResult(new Intent(android.provider.Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS), 0);

I'm able to open all manage applications. Is there any way to open browser settings directly?

Thanks

Settings of an application is stored in Shared Preferances of the application and each application has different directories to store it by default. For your internet browser the settings are stored in "data/data/com.android.browser/shared-prefs/" direcory. There is a XML file named as "com.android.browser_preferences.xml" that has these settings. Access this file by shared prefs and make changes. Code.

String path = "data/data/com.android.browser/shared-prefs/";
String file = "com.android.browser_preferences.xml";
SharedPreferances setting = getSharedPreferances(path+file, MODE_PRIVATE, null);
SharedPreferances.editor edit = setting.edit();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM