本文整理匯總了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);
}
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例6: onCustomTabsServiceConnected
import android.support.customtabs.CustomTabsClient; //導入方法依賴的package包/類
@Override
public void onCustomTabsServiceConnected(ComponentName componentName, CustomTabsClient customTabsClient) {
customTabsClient.warmup(0L);
mCustomTabsSession = customTabsClient.newSession(null);
}
示例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