0

I know its similar to this question How to get a list of installed media players, but I am not able to get a list of installed players. Can someone help me on this?

Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.withAppendedPath(MediaStore.Video.Media.INTERNAL_CONTENT_URI,"1"); intent.setData(uri); 
playerList = packageManager.queryIntentActivities(intent, 0);
Community
  • 1
  • 1
harish
  • 1,755
  • 6
  • 22
  • 36
  • Pleas show us some code you have and how are you testing this? – st0le Nov 14 '11 at 09:36
  • Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.withAppendedPath(MediaStore.Video.Media.INTERNAL_CONTENT_URI,"1"); intent.setData(uri); playerList = packageManager.queryIntentActivities(intent, 0); – harish Nov 14 '11 at 09:53
  • i get IllegalStateException at playerList = packageManager.queryIntentActivities(intent, 0); – harish Nov 14 '11 at 09:58
  • are you positive there are applicatons and some videos present on the device? – st0le Nov 14 '11 at 09:58
  • yes. but I only want the list of players installed in the device – harish Nov 14 '11 at 10:15

1 Answers1

2
Intent resolveIntent = new Intent(Intent.ACTION_VIEW);
resolveIntent.setDataAndType(Uri.parse("file://"), MIMEType);
List<ResolveInfo> pkgAppsList = mContext.getPackageManager().queryIntentActivities(resolveIntent, PackageManager.MATCH_DEFAULT_ONLY| PackageManager.GET_RESOLVED_FILTER);
Ritter Liu
  • 86
  • 3