1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 17:57:16 +00:00

Open link chooser

This commit is contained in:
M66B 2022-06-29 16:51:29 +02:00
parent 405db1e415
commit 5037be126d
2 changed files with 19 additions and 1 deletions

View file

@ -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;
}

View file

@ -916,7 +916,16 @@ public class Helper {
" task=" + task +
" 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 {
Intent view = new Intent(Intent.ACTION_VIEW);
if (mimeType == null)