我正在尝试使用项目中的Chrome自定义标签替换网络视图。要替换webview,我需要在Android标签提供的Chrome标签中进行回调。所以在那里有任何可用的回调,如果可用,那么它们是什么?请提前帮助我。
答案 0 :(得分:4)
您只能在Chrome自定义标签中提供以下回调:
/**
* 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.chrome.com/multidevice/android/customtabs#implementationguide