如何从我的Android应用程序中打开默认浏览器设置?
按我的要求,我必须从我的应用程序清除默认浏览器的缓存。我想从我的应用程序中打开的浏览器设置,使用户可以清除缓存。
通过使用以下code。
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?
感谢
的应用程序的设置被存储在应用程序的共享preferances和每个应用程序具有不同的目录默认将其存储。为了您的互联网浏览器的设置存储在数据/数据/ com.android.browser / shared- preFS /猪病。有一个名为作为具有这些设置com.android.browser_ preferences.xml一个XML文件。通过访问共享preFS此文件并进行更改。
code。
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();