java选择器意图没有应用程序
我的问题是,当这个意图开始时,没有应用程序可以显示。为什么呢?我需要所有的应用程序都是可见的,因为一旦点击按钮,就会转到用户想要的任何应用程序并保存它(默认使用此应用程序)。解决办法是什么
Intent intent = new Intent(Intent.ACTION_ALL_APPS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
String title = getResources().getString(R.string.chooser_title);
Intent chooser = Intent.createChooser(intent, title);
chooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(chooser);
# 1 楼答案
试试-
# 2 楼答案
这将为您提供列表中的所有应用程序-
pkgAppsList将包含所有应用程序的列表。希望这能解决你的问题