The Android system can get the default browser information in the following ways:
public static Activityinfo Getbrowserapp (context context) {
String default_browser = "Android.intent.category.DEFAULT";
String browsable = "Android.intent.category.BROWSABLE";
String view = "Android.intent.action.VIEW";
Intent Intent = new Intent (view);
Intent.addcategory (Default_browser);
Intent.addcategory (browsable);
Uri uri = Uri.parse ("http://");
Intent.setdataandtype (URI, NULL);
Find out all browser programs currently installed on your phone
list<resolveinfo> resolveinfolist = Context.getpackagemanager (). Queryintentactivities (Intent, Packagemanager.get_intent_filters);
if (resolveinfolist.size () > 0) {
Activityinfo activityinfo = resolveinfolist.get (0). Activityinfo;
String PackageName = activityinfo.packagename;
String className = activityinfo.name;
return activityinfo;
} else {
return null;
}
}
Android Get default browser information