Fixed choosing custom tabs

pull/209/head
M66B 2 years ago
parent 624142e524
commit 1bc688dac3

@ -945,27 +945,21 @@ public class Helper {
if (task)
view.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if ("chooser".equals(open_with_pkg)) {
if ("chooser".equals(open_with_pkg) && !open_with_tabs) {
try {
if (open_with_tabs) {
EntityLog.log(context, "Launching direct uri=" + uri +
" intent=" + view +
" extras=" + TextUtils.join(", ", Log.getExtras(view.getExtras())));
context.startActivity(view);
} else {
EntityLog.log(context, "Launching chooser uri=" + uri +
" intent=" + view +
" extras=" + TextUtils.join(", ", Log.getExtras(view.getExtras())));
Intent chooser = Intent.createChooser(view, context.getString(R.string.title_select_app));
context.startActivity(chooser);
}
EntityLog.log(context, "Launching chooser uri=" + uri +
" intent=" + view +
" extras=" + TextUtils.join(", ", Log.getExtras(view.getExtras())));
Intent chooser = Intent.createChooser(view, context.getString(R.string.title_select_app));
context.startActivity(chooser);
} catch (ActivityNotFoundException ex) {
Log.w(ex);
reportNoViewer(context, uri, ex);
}
} else if (browse || !open_with_tabs) {
try {
view.setPackage(open_with_pkg);
if (!"chooser".equals(open_with_pkg))
view.setPackage(open_with_pkg);
EntityLog.log(context, "Launching view uri=" + uri +
" intent=" + view +
" extras=" + TextUtils.join(", ", Log.getExtras(view.getExtras())));
@ -1015,7 +1009,8 @@ public class Helper {
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.intent.putExtra(Browser.EXTRA_HEADERS, headers);
customTabsIntent.intent.setPackage(open_with_pkg);
if (!"chooser".equals(open_with_pkg))
customTabsIntent.intent.setPackage(open_with_pkg);
try {
EntityLog.log(context, "Launching tab uri=" + uri +

Loading…
Cancel
Save