2011-11-14 76 views
0

我知道它類似於這個問題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); 
+0

普萊斯告訴我們一些代碼,你已經和你怎麼測試呢? – st0le

+0

Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.withAppendedPath(MediaStore.Video.Media.INTERNAL_CONTENT_URI,「1」); \t \t \t \t \t intent.setData(uri); \t \t \t \t \t playerList = packageManager.queryIntentActivities(intent,0); – harish

+0

我得到IllegalStateException在playerList = packageManager.queryIntentActivities(intent,0); – harish

回答

0
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); 
相關問題