public static void openUrl(final Context context, final String url, final boolean forceIntentChooser) {
        if (StringUtils.isBlank(url)) {
            return;
        }

        try {
            final Uri uri = Uri.parse(url);
            if (Settings.getUseCustomTabs() && ProcessUtils.isChromeLaunchable() && !StringUtils.equals(uri.getScheme(), "mailto")) {
                openCustomTab(context, url);
                return;
            }

            final Intent viewIntent = new Intent(Intent.ACTION_VIEW, uri);

            // Always shows an application chooser with all possible targets
            if (forceIntentChooser) {
                final Intent chooser = Intent.createChooser(viewIntent, context.getString(R.string.cache_menu_browser));
                chooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);

                final Intent customTabs = new Intent(context, StartWebviewActivity.class);

                final List<ResolveInfo> alreadyExistingShareIntents = context.getPackageManager().queryIntentActivities(viewIntent, PackageManager.MATCH_DEFAULT_ONLY);
                final List<Intent> additionalTargetedShareIntents = new ArrayList<>();
                customTabs.setData(uri);
                additionalTargetedShareIntents.add(customTabs);

                // on some devices, only c:geo is returned as possible share target, if it is set as default.
                // Therefore we need to query the installed browsers and check, whether it is already listed in the intent chooser.
                for (ResolveInfo resolveInfo : ProcessUtils.getInstalledBrowsers(context)) {
                    if (IterableUtils.find(alreadyExistingShareIntents,
                            info -> resolveInfo.activityInfo.packageName.equals(info.activityInfo.packageName)) == null) {
                        final Intent targetedShare = new Intent(Intent.ACTION_VIEW, uri);
                        targetedShare.setPackage(resolveInfo.activityInfo.packageName);
                        additionalTargetedShareIntents.add(targetedShare);
                    }
                }

                chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, additionalTargetedShareIntents.toArray(new Parcelable[]{}));
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                    chooser.putExtra(Intent.EXTRA_EXCLUDE_COMPONENTS, new Parcelable[]{new ComponentName(context, CacheDetailActivity.class)});
                }

                context.startActivity(chooser);
            } else {
                context.startActivity(viewIntent);
            }

        } catch (final ActivityNotFoundException e) {
            Log.e("Cannot find suitable activity for URL '" + url + "'", e);
            ActivityMixin.showToast(context, R.string.err_application_no);
        }
    }
Opens a URL in browser, in the registered default application or (if activated by the user in the settings) with customTabs
(exception: uri using "mailto" scheme are never opened in custom tab)
main/src/main/java/cgeo/geocaching/utils/ShareUtils.java