fix: set category to browser search intent to avoid unexpected query result

This commit is contained in:
Eiichiro Adachi 2022-06-27 15:09:29 +09:00
parent 65f0459579
commit 609ce9704a
1 changed files with 1 additions and 0 deletions

View File

@ -53,6 +53,7 @@ public class CustomTabsHelper {
PackageManager pm = context.getPackageManager();
// Get default VIEW intent handler.
Intent activityIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com"));
activityIntent.addCategory(Intent.CATEGORY_BROWSABLE);
ResolveInfo defaultViewHandlerInfo = pm.resolveActivity(activityIntent, 0);
String defaultViewHandlerPackageName = null;
if (defaultViewHandlerInfo != null) {