本文整理匯總了Java中org.apache.cordova.CordovaPlugin.onOverrideUrlLoading方法的典型用法代碼示例。如果您正苦於以下問題:Java CordovaPlugin.onOverrideUrlLoading方法的具體用法?Java CordovaPlugin.onOverrideUrlLoading怎麽用?Java CordovaPlugin.onOverrideUrlLoading使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.cordova.CordovaPlugin
的用法示例。
在下文中一共展示了CordovaPlugin.onOverrideUrlLoading方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onOverrideUrlLoading
import org.apache.cordova.CordovaPlugin; //導入方法依賴的package包/類
/**
* Called when the URL of the webview changes.
*
* @param url The URL that is being changed to.
* @return Return false to allow the URL to load, return true to prevent the URL from loading.
*/
public boolean onOverrideUrlLoading(String url) {
// Deprecated way to intercept URLs. (process <url-filter> tags).
// Instead, plugins should not include <url-filter> and instead ensure
// that they are loaded before this function is called (either by setting
// the onload <param> or by making an exec() call to them)
for (PluginEntry entry : this.entryMap.values()) {
List<String> urlFilters = urlMap.get(entry.service);
if (urlFilters != null) {
for (String s : urlFilters) {
if (url.startsWith(s)) {
return getPlugin(entry.service).onOverrideUrlLoading(url);
}
}
} else {
CordovaPlugin plugin = pluginMap.get(entry.service);
if (plugin != null && plugin.onOverrideUrlLoading(url)) {
return true;
}
}
}
return false;
}