I donβt know how to set up a dialogue, I saw different layouts on different devices. But you can use PackageManager.queryIntentActivities(Intent intent, int flag) to get all the actions that could handle this intention. And use the list data to create your own selection.
EDIT: demo
final Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.google.com")); PackageManager pm = getPackageManager(); final List<ResolveInfo> infos = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); CharSequence[] names = new CharSequence[infos.size()]; for (int i = 0; i < infos.size(); i++) { names[i] = infos.get(i).loadLabel(pm); } new AlertDialog.Builder(this).setItems(names, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ResolveInfo info = infos.get(which); intent.setClassName(info.activityInfo.packageName, info.activityInfo.name); startActivity(intent); } }).show();
source share