Within my app, is it possible to programatically change the Android browser\'s homepage url? If so, how can I accomplish this?
For example, if you run this popular
I did not try this myself, but BrowserSettings has a public interface setHomePage:
public void setHomePage(Context context, String url) {
Editor ed = PreferenceManager.
getDefaultSharedPreferences(context).edit();
ed.putString(PREF_HOMEPAGE, url);
ed.commit();
homeUrl = url;
}
It is used in BrowserBookmarksPage like this:
BrowserSettings.getInstance().setHomePage(this, [URL]);
But that BrowserSettings class is only accessible from that package. So maybe accessing the shared preferences is easier... ?
MORE...
Not really here to be giving a lesson. It may be possible to do, maybe with some native code accessing the XML file with the preferences for the Browser or other ways like this, but...