Here are the examples of the java api class android.support.customtabs.CustomTabsSession taken from open source projects.
1. BottomBarManager#onReceive()
Project: custom-tabs-client
File: BottomBarManager.java
File: BottomBarManager.java
@Override public void onReceive(Context context, Intent intent) { int clickedId = intent.getIntExtra(CustomTabsIntent.EXTRA_REMOTEVIEWS_CLICKED_ID, -1); Toast.makeText(context, "Current URL " + intent.getDataString() + "\nClicked id " + clickedId, Toast.LENGTH_SHORT).show(); CustomTabsSession session = SessionHelper.getCurrentSession(); if (session == null) return; if (clickedId == R.id.play_pause) { MediaPlayer player = sMediaPlayerWeakRef.get(); if (player != null) { boolean isPlaying = player.isPlaying(); if (isPlaying) player.pause(); else player.start(); // Update the play/stop icon to respect the current state. session.setSecondaryToolbar(createRemoteViews(context, isPlaying), getClickableIDs(), getOnClickPendingIntent(context)); } } else if (clickedId == R.id.cover) { // Clicking on the cover image will dismiss the bottom bar. session.setSecondaryToolbar(null, null, null); } }
2. CustomTabActivityHelper#mayLaunchUrl()
Project: Tabby
File: CustomTabActivityHelper.java
File: CustomTabActivityHelper.java
public boolean mayLaunchUrl(Uri uri, Bundle extras, List<Bundle> otherLikelyBundles) { if (mClient == null) return false; CustomTabsSession session = getSession(); if (session == null) return false; return session.mayLaunchUrl(uri, extras, otherLikelyBundles); }
3. CustomTabActivityHelper#mayLaunchUrl()
Project: sbt-android
File: CustomTabActivityHelper.java
File: CustomTabActivityHelper.java
/** * @see {@link CustomTabsSession#mayLaunchUrl(Uri, Bundle, List)} * @return true if call to mayLaunchUrl was accepted */ public boolean mayLaunchUrl(Uri uri, Bundle extras, List<Bundle> otherLikelyBundles) { if (mClient == null) return false; CustomTabsSession session = getSession(); if (session == null) return false; return session.mayLaunchUrl(uri, extras, otherLikelyBundles); }
4. CustomTabActivityHelper#mayLaunchUrl()
Project: plaid
File: CustomTabActivityHelper.java
File: CustomTabActivityHelper.java
/** * @see {@link CustomTabsSession#mayLaunchUrl(Uri, Bundle, List)} * @return true if call to mayLaunchUrl was accepted */ public boolean mayLaunchUrl(Uri uri, Bundle extras, List<Bundle> otherLikelyBundles) { if (mClient == null) return false; CustomTabsSession session = getSession(); if (session == null) return false; return session.mayLaunchUrl(uri, extras, otherLikelyBundles); }
5. CustomTabActivityHelper#mayLaunchUrl()
Project: custom-tabs-client
File: CustomTabActivityHelper.java
File: CustomTabActivityHelper.java
/** * @see {@link CustomTabsSession#mayLaunchUrl(Uri, Bundle, List)}. * @return true if call to mayLaunchUrl was accepted. */ public boolean mayLaunchUrl(Uri uri, Bundle extras, List<Bundle> otherLikelyBundles) { if (mClient == null) return false; CustomTabsSession session = getSession(); if (session == null) return false; return session.mayLaunchUrl(uri, extras, otherLikelyBundles); }
6. CustomTabActivityHelper#mayLaunchUrl()
Project: Anki-Android
File: CustomTabActivityHelper.java
File: CustomTabActivityHelper.java
/** * @see {@link CustomTabsSession#mayLaunchUrl(Uri, Bundle, List)}. * @return true if call to mayLaunchUrl was accepted. */ public boolean mayLaunchUrl(Uri uri, Bundle extras, List<Bundle> otherLikelyBundles) { if (mClient == null) return false; CustomTabsSession session = getSession(); if (session == null) return false; return session.mayLaunchUrl(uri, extras, otherLikelyBundles); }
7. CustomTabsDelegate#mayLaunchUrl()
Project: materialistic
File: CustomTabsDelegate.java
File: CustomTabsDelegate.java
/** * @see {@link CustomTabsSession#mayLaunchUrl(Uri, Bundle, List)}. * @return true if call to mayLaunchUrl was accepted. */ public boolean mayLaunchUrl(Uri uri, Bundle extras, List<Bundle> otherLikelyBundles) { if (mClient == null) { return false; } CustomTabsSession session = getSession(); return session != null && session.mayLaunchUrl(uri, extras, otherLikelyBundles); }