Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android:列出能够使用png';s_Android - Fatal编程技术网

Android:列出能够使用png';s

Android:列出能够使用png';s,android,Android,我想获得一个Android设备上能够使用(或与之一起发布)PNG的应用程序列表 我正在使用以下代码: final Intent msg = new Intent(Intent.ACTION_MAIN, null); msg.setType("image/png"); final List pkgAppsList = context.getPackageManager().queryIntentActivities(msg, 0); 但它返回零,这并不反映现实。 有没有其他方法可以询问框架的应用

我想获得一个Android设备上能够使用(或与之一起发布)PNG的应用程序列表

我正在使用以下代码:

final Intent msg = new Intent(Intent.ACTION_MAIN, null);
msg.setType("image/png");
final List pkgAppsList = context.getPackageManager().queryIntentActivities(msg, 0);
但它返回零,这并不反映现实。 有没有其他方法可以询问框架的应用程序功能

Pom

试试这个

final Intent msg = new Intent();
msg.setType("image/png");
PackageManager pm = this.getPackageManager();
final List<ResolveInfo> apps = pm.queryIntentActivities(msg, 0);

Log.d("TTT", "Got " + apps.size());
for (int i = 0; i < apps.size(); ++i) {
    Log.d("TTT", apps.get(i).loadLabel(pm).toString());
}
final Intent msg=new Intent();
msg.setType(“图像/png”);
PackageManager pm=this.getPackageManager();
最终列表应用程序=pm.querytentActivities(msg,0);
Log.d(“TTT”,“Got”+apps.size());
对于(int i=0;i