how to get a list of installed video players programmatically?

断了今生、忘了曾经 提交于 2020-01-06 08:33:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!