2017-05-01 61 views
2

プロジェクトのChromeカスタムタブでウェブビューを置き換えようとしています。 webviewを置き換えるにはアンドロイドウェブビューのようにChromeタブでコールバックが必要です。だから、コールバックが利用可能かどうか、利用可能な場合は、それは何ですか?事前に感謝してください。Chromeからのコールバックの取得方法Webビューのようなアンドロイドのタブは、shouldOverrideUrlLoading、onLoadResource、onPageFinishedを提供します

答えて

2

あなただけのクロームカスタムタブで、次のコールバックを提供することができます:

/** 
* Sent when the tab has started loading a page. 
*/ 
public static final int NAVIGATION_STARTED = 1; 

/** 
* Sent when the tab has finished loading a page. 
*/ 
public static final int NAVIGATION_FINISHED = 2; 

/** 
* Sent when the tab couldn't finish loading due to a failure. 
*/ 
public static final int NAVIGATION_FAILED = 3; 

/** 
* Sent when loading was aborted by a user action before it finishes like clicking on a link 
* or refreshing the page. 
*/ 
public static final int NAVIGATION_ABORTED = 4; 

/** 
* Sent when the tab becomes visible. 
*/ 
public static final int TAB_SHOWN = 5; 

/** 
* Sent when the tab becomes hidden. 
*/ 
public static final int TAB_HIDDEN = 6; 

、コールバックを取り付け、通常のようにカスタムタブサービスにバインドし、newSessionの呼び出し中に、ちょうどあなたのコールバックを渡すには()。

詳細:https://developer.android.com/reference/android/support/customtabs/CustomTabsClient.html#newSession(android.support.customtabs.CustomTabsCallback)

実装ガイド:https://developer.chrome.com/multidevice/android/customtabs#implementationguide

1

それはアンドロイドでカスタムクローム]タブでは不可能です。

関連する問題