如何以编程方式获取已安装的视频播放器列表?

时间:2011-11-14 09:15:41

标签: android video media-player

我知道它类似于这个问题How to get a list of installed media players,但我无法获得已安装播放器的列表。有人可以帮我吗?

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);

1 个答案:

答案 0 :(得分:1)

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);