Sarala Hegde
Sarala Hegde

Reputation: 21

How to fetch all the browser names installed on android mobile

I am new to android application development.

I want to fetch the list of installed browser names on android mobile through the application. How can I do that?

Upvotes: 2

Views: 1660

Answers (2)

Alexander
Alexander

Reputation: 1098

From your question I infer you probably want the user to choose a browser to open a URL?! If you simply want the user to pick one of the installed browsers to open a URL given by your app, you don't have to display a list of them yourself. Android will care about it; see this

Upvotes: 0

Matthieu
Matthieu

Reputation: 16417

I did not test this, but the most obvious way should be to use the PackageManager to find what application / Activity can resolve the Intent to browse a web address.

The function you are looking for is there : http://developer.android.com/reference/android/content/pm/PackageManager.html#queryIntentActivities(android.content.Intent, int)

The Intent should have action ACTION_VIEW and the data could be "http://www.google.com" or any web URL you would like (as long as it starts with http)

Upvotes: 3

Related Questions