List of installed Android media players

I am trying to get a list of all applications that can handle media installed on Android.

I tried the methods listed here ( How to get a list of installed media players ), but none of them worked. They all return an empty list, and I have several media players installed that are all recognized using the Droid headset ( https://play.google.com/store/apps/details?id=tvk.headvol ).

Can someone suggest some alternative method or can they have and understand what the problem is? Do I need to set any permissions?

Edit: I found the solution myself:

Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
List<ResolveInfo> pkgAppsList = packageManager.queryBroadcastReceivers(intent, 0);
0
source share
1

:

PackageManager packageManager = this.getPackageManager();
List<ResolveInfo> pkgAppsList;
Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
pkgAppsList = packageManager.queryBroadcastReceivers(intent, 0);

, ACTION_MEDIA_BUTTON. -.

+1

All Articles