fix: try to open with Chrome if default browser app does not support custom tabs
This commit is contained in:
parent
ee1b0d7ff7
commit
65f0459579
|
@ -6,6 +6,7 @@ import android.content.IntentFilter;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
|
@ -59,7 +60,11 @@ public class CustomTabsHelper {
|
|||
}
|
||||
|
||||
// Get all apps that can handle VIEW intents.
|
||||
List<ResolveInfo> resolvedActivityList = pm.queryIntentActivities(activityIntent, 0);
|
||||
int flags = 0;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
flags |= PackageManager.MATCH_ALL;
|
||||
}
|
||||
List<ResolveInfo> resolvedActivityList = pm.queryIntentActivities(activityIntent, flags);
|
||||
List<String> packagesSupportingCustomTabs = new ArrayList<>();
|
||||
for (ResolveInfo info : resolvedActivityList) {
|
||||
Intent serviceIntent = new Intent();
|
||||
|
|
Loading…
Reference in New Issue