mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 06:39:54 +01:00
Try GET_CONTENT first, fall back to OPEN_DOCUMENT.
This commit is contained in:
@@ -610,7 +610,13 @@ public class UiUtils {
|
|||||||
@Nullable ActivityResultLauncher<String[]> docLauncher,
|
@Nullable ActivityResultLauncher<String[]> docLauncher,
|
||||||
ActivityResultLauncher<String> contentLauncher,
|
ActivityResultLauncher<String> contentLauncher,
|
||||||
String contentType) {
|
String contentType) {
|
||||||
// Try OPEN_DOCUMENT if available, fall back to GET_CONTENT
|
// Try GET_CONTENT, fall back to OPEN_DOCUMENT if available
|
||||||
|
try {
|
||||||
|
contentLauncher.launch(contentType);
|
||||||
|
return;
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
logException(LOG, WARNING, e);
|
||||||
|
}
|
||||||
if (docLauncher != null) {
|
if (docLauncher != null) {
|
||||||
try {
|
try {
|
||||||
docLauncher.launch(new String[] {contentType});
|
docLauncher.launch(new String[] {contentType});
|
||||||
@@ -619,12 +625,6 @@ public class UiUtils {
|
|||||||
logException(LOG, WARNING, e);
|
logException(LOG, WARNING, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
Toast.makeText(ctx, R.string.error_start_activity, LENGTH_LONG).show();
|
||||||
contentLauncher.launch(contentType);
|
|
||||||
} catch (ActivityNotFoundException e) {
|
|
||||||
logException(LOG, WARNING, e);
|
|
||||||
Toast.makeText(ctx, R.string.error_start_activity,
|
|
||||||
LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user