Open link chooser

pull/208/head
M66B 3 years ago
parent 405db1e415
commit 5037be126d

@ -587,6 +587,15 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
} }
} }
Drawable android = context.getDrawable(R.drawable.twotone_android_24);
android.setBounds(0, 0, dp24, dp24);
pkgs.add(new Package(
android,
context.getString(R.string.title_select_app),
"chooser",
false,
true));
return pkgs; return pkgs;
} }

@ -916,7 +916,16 @@ public class Helper {
" task=" + task + " task=" + task +
" pkg=" + open_with_pkg + ":" + open_with_tabs); " pkg=" + open_with_pkg + ":" + open_with_tabs);
if (browse || !open_with_tabs) { if ("chooser".equals(open_with_pkg)) {
Intent view = new Intent(Intent.ACTION_VIEW, uri);
Intent chooser = Intent.createChooser(view, context.getString(R.string.title_select_app));
try {
context.startActivity(chooser);
} catch (ActivityNotFoundException ex) {
Log.w(ex);
reportNoViewer(context, uri, ex);
}
} else if (browse || !open_with_tabs) {
try { try {
Intent view = new Intent(Intent.ACTION_VIEW); Intent view = new Intent(Intent.ACTION_VIEW);
if (mimeType == null) if (mimeType == null)

Loading…
Cancel
Save