mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 13:44:40 +00:00
Bring back open with
This commit is contained in:
parent
81519209d4
commit
855e277e83
1 changed files with 17 additions and 0 deletions
|
@ -22,6 +22,7 @@ package eu.faircode.email;
|
||||||
import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION;
|
import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -566,6 +567,22 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
||||||
Log.i("Open link cancelled");
|
Log.i("Open link cancelled");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.setNeutralButton(R.string.title_browse, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
// https://developer.android.com/training/basics/intents/sending#AppChooser
|
||||||
|
Uri uri = Uri.parse(etLink.getText().toString());
|
||||||
|
Log.i("Open link with uri=" + uri);
|
||||||
|
Intent view = new Intent(Intent.ACTION_VIEW, uri);
|
||||||
|
Intent chooser = Intent.createChooser(view, context.getString(R.string.title_select_app));
|
||||||
|
try {
|
||||||
|
startActivity(chooser);
|
||||||
|
} catch (ActivityNotFoundException ex) {
|
||||||
|
Log.w(ex);
|
||||||
|
Helper.view(context, uri, true, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
.create();
|
.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue