Android cihazda Özel Sekmeleri destekleyen bir tarayıcı olup olmadığını kontrol edin.

Varsayılan tarayıcının veya cihazdaki herhangi bir tarayıcının Özel Sekmeleri destekleyip desteklemediğini öğrenmek istiyorsanız CustomTabsClient içindeki getPackageName yardımcısını kullanın:

String packageName = CustomTabsClient.getPackageName(
        context, 
        Collections.emptyList()
);
if (packageName == null) {
    // Custom Tabs are not supported by the default browser
}

Cihazdaki herhangi bir tarayıcının Özel Sekmeleri destekleyip desteklemediğini de kontrol edebilirsiniz:

// Get all apps that can handle VIEW intents and Custom Tab service connections.
Intent activityIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com"));
PackageManager packageManager = context.getPackageManager();
List<ResolveInfo> viewIntentHandlers = packageManager.queryIntentActivities(activityIntent, 0);
// Get a package that supports Custom Tabs
String packageName = CustomTabsClient.getPackageName(
        context, 
        viewIntentHandlers,
        true /* ignore default */
);
if (packageName == null) {
    // Custom Tabs are not supported by any browser on the device
}

Android 11'de paket görünürlüğüyle ilgili değişiklikler yapıldı. Android uygulamanız API düzeyi 30 veya üstünü hedefliyorsa AndroidManifest.xml öğesine aşağıdaki sorgular bölümünü eklemeniz gerekir. Aksi takdirde yukarıdaki kod snippet'i sonuç döndürmez:

<queries>
    <intent>
        <action android:name=
            "android.support.customtabs.action.CustomTabsService" />
    </intent>
</queries>