拿到能打开指定类型文件的应用程序
Intent it = new Intent(); it.setType("image/*") List<ResolveInfo> ra = this.getPackageManager().queryIntentActivities(it,0); for(int i=0;i<ra.size();i++){ ActivityInfo ai = ra.get(i).activityInfo; Drawable icon = ai.loadIcon(this.getPackageManager()); //图标 String label = ai.loadLabel(this.getPackageManager()).toString(); //名称 ComponentName c = new ComponentName(ai.applicationInfo.packageName, ai.name); //组件名,可以通过startActivity()打开此应用 }
如果你要打开其他的媒体资源:videooraudio
指定相应的Type即可!
相关推荐
pengjin 2020-01-28
xilove0 2020-01-14
csdnuuu 2019-12-27
dingguagua 2013-07-23
fuzhangandroid 2011-04-07
peixiaopao 2011-09-12
西木 2011-08-17
老菜鸟自习室 2011-08-05
Mexican 2011-07-27
sgafdsg 2011-07-19
sgafdsg 2011-06-14
易辰Android 2011-05-18
ElvenShi 2015-01-19
mingming 2015-01-13
taiyuanwuyin 2015-03-31
图灵的梦 2015-04-26
李战磊 2015-05-19