當前位置: 首頁>>代碼示例>>Java>>正文


Java CustomTabsClient.warmup方法代碼示例

本文整理匯總了Java中android.support.customtabs.CustomTabsClient.warmup方法的典型用法代碼示例。如果您正苦於以下問題:Java CustomTabsClient.warmup方法的具體用法?Java CustomTabsClient.warmup怎麽用?Java CustomTabsClient.warmup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.customtabs.CustomTabsClient的用法示例。


在下文中一共展示了CustomTabsClient.warmup方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCustomTabsServiceConnected

import android.support.customtabs.CustomTabsClient; //導入方法依賴的package包/類
@Override
public void onCustomTabsServiceConnected(ComponentName componentName, CustomTabsClient customTabsClient) {

    if (customTabsClient != null) {
        customTabsClient.warmup(0L);

        // Create a new session
        mCustomTabsSession = customTabsClient.newSession(null);

        // Let the session know that it may launch a URL soon
        if (!TextUtils.isEmpty(mWebsiteUrl)) {
            Uri uri = Uri.parse(mWebsiteUrl);
            if (uri != null && mCustomTabsSession != null) {

                // If this returns true, custom tabs will work,
                // otherwise, you need another alternative if you don't want the user
                // to be launched out of the app by default
                mCustomTabsSession.mayLaunchUrl(uri, null, null);
            }
        }
    }
}
 
開發者ID:aknkaplanoglu,項目名稱:Sportmix,代碼行數:23,代碼來源:CustomTabServiceController.java

示例2: onCustomTabsServiceConnected

import android.support.customtabs.CustomTabsClient; //導入方法依賴的package包/類
@Override
public void onCustomTabsServiceConnected(ComponentName name, CustomTabsClient client) {
    client.warmup(0);
    customTabsSession = client.newSession(new CustomTabsCallback());
    if (customTabsSession == null) {
        return;
    }
    // Delay to not slow down native app loading
    communicationHandler.postDelayed(() -> customTabsSession.mayLaunchUrl(Uri.parse(Utils.getUrl(HassActivity.this)), null, null), 1500);
}
 
開發者ID:Maxr1998,項目名稱:home-assistant-Android,代碼行數:11,代碼來源:HassActivity.java

示例3: onCustomTabsServiceConnected

import android.support.customtabs.CustomTabsClient; //導入方法依賴的package包/類
@Override
public void onCustomTabsServiceConnected(ComponentName name, CustomTabsClient client) {
    client.warmup(0);
    customTabsSession = client.newSession(new CustomTabsCallback());
    if (customTabsSession == null) {
        return;
    }
    // Delay to not slow down native app loading
    customTabsSession.mayLaunchUrl(Uri.parse(Common.CROWDIN_URL), null, null);
}
 
開發者ID:Maxr1998,項目名稱:home-assistant-Android,代碼行數:11,代碼來源:SettingsActivity.java

示例4: setUpCustomTabsService

import android.support.customtabs.CustomTabsClient; //導入方法依賴的package包/類
public void setUpCustomTabsService(String url, Context context) {
  ctConnection = new CustomTabsServiceConnection() {
    @Override public void onCustomTabsServiceConnected(ComponentName componentName,
        CustomTabsClient customTabsClient) {
      customTabsClient.warmup(0);
      customTabsSession = getSession(customTabsClient);
      customTabsSession.mayLaunchUrl(Uri.parse(url), null, null);
    }

    @Override public void onServiceDisconnected(ComponentName name) {
    }
  };
  CustomTabsClient.bindCustomTabsService(context, CHROME_PACKAGE, ctConnection);
}
 
開發者ID:Aptoide,項目名稱:aptoide-client-v8,代碼行數:15,代碼來源:CustomTabsHelper.java

示例5: onCustomTabsServiceConnected

import android.support.customtabs.CustomTabsClient; //導入方法依賴的package包/類
@Override
public void onCustomTabsServiceConnected(ComponentName componentName, CustomTabsClient customTabsClient) {
    if (customTabsClient == null) {
        return;
    }
    Log.d(TAG, "CustomTabs Service connected");
    customTabsClient.warmup(0L);
    session.set(customTabsClient.newSession(null));
    sessionLatch.countDown();
}
 
開發者ID:auth0,項目名稱:Auth0.Android,代碼行數:11,代碼來源:CustomTabsController.java

示例6: onCustomTabsServiceConnected

import android.support.customtabs.CustomTabsClient; //導入方法依賴的package包/類
@Override
public void onCustomTabsServiceConnected(ComponentName componentName, CustomTabsClient customTabsClient) {
    customTabsClient.warmup(0L);
    mCustomTabsSession = customTabsClient.newSession(null);
}
 
開發者ID:akexorcist,項目名稱:Android-SleepingForLess,代碼行數:6,代碼來源:ExternalBrowserUtility.java

示例7: warmUp

import android.support.customtabs.CustomTabsClient; //導入方法依賴的package包/類
private boolean warmUp(){
    boolean success = false;
    final CustomTabsClient client = mCustomTabPluginHelper.getClient();
    if (client != null) success = client.warmup(0);
    return success;
}
 
開發者ID:EddyVerbruggen,項目名稱:cordova-plugin-safariviewcontroller,代碼行數:7,代碼來源:ChromeCustomTabPlugin.java


注:本文中的android.support.customtabs.CustomTabsClient.warmup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。