问题
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);
回答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);
来源:https://stackoverflow.com/questions/8119379/how-to-get-a-list-of-installed-video-players-programmatically