user2517419
user2517419

Reputation:

List of all default application programmatically

How can I get a list of Default applications in Android devices programmatically?

For example, in my phone there may be two Video player.

  1. Samsung Video player
  2. VLC.

But it is quite possible that VLC is set as default player. Like this, I want to find programatically all the Default applications. I have been able to get list of Installed applications and Launcher applications but how could I find list of all default applications.

Upvotes: 2

Views: 1747

Answers (1)

Adam Nybäck
Adam Nybäck

Reputation: 855

You can use getPreferredActivities() like this:

    List<IntentFilter> filters = new ArrayList<IntentFilter>();
    List<ComponentName> activities = new ArrayList<ComponentName>();
    getPackageManager().getPreferredActivities(filters, activities, null);

This will put all default activities in the list called activities.

Upvotes: 2

Related Questions