1
How do I list/check all browsers installed on an Android device via Java?
1
How do I list/check all browsers installed on an Android device via Java?
2
It is impossible to know/determine which applications are of the Browser type, for the simple reason that there is no identifier informing this for Android. It is also very risky for you to search all the Packages you own browser
for example.
A suggestion is that, you can list, for example, which Activity
'can’t open a certain Intent
with a URL:
PackageManager packageManager = context.getPackageManager();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.google.com"));
List<ResolveInfo> list = packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
for (ResolveInfo info : list) {
String name = info.name;
}
Browser other questions tagged java android android-studio
You are not signed in. Login or sign up in order to post.
Good idea @sicachester! But one question, what is the type of context?
– Duds
Your
Activity
is already aContext
, see here http://developer.android.com/reference/android/app/Activity.html. In this case, within itsActivity
, only usegetPackageManager()
, withoutcontext
– rsicarelli