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 app with Android 2.3 (all that I've tested), it will change your homepage to http://www.searchmobileonline.com -- https://market.android.com/details?id=goldenshorestechnologies.brightestflashlight.free
Thanks!
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With