【发布时间】:2016-03-05 01:03:07
【问题描述】:
我的问题与这个问题完全相同,但适用于 Android 而不是 iOS。
Get URL from remote URL in webview and open it in safari
任何人都有想法。我正在创建一个跨平台应用程序,并且我已经使用 Clayton 的答案让它适用于 iOS,并进行了一些调整以使用控制器打开。但是当在 Android 上尝试不同的方法时,它不起作用。这与我得到的一样接近(这是 Aaron 在同一页面上提供的),而且它不太正确,因为它在新的浏览器窗口以及应用程序 web 视图中打开了远程网页:
$.floorView.addEventListener('load', function(e) {
if (e.url.indexOf("http") !== -1) {
// stop the event
e.bubble = false;
// stop the url from loading
$.floorView.stopLoading();
// open
Ti.Platform.openURL(e.url);
}
});
谢谢!
【问题讨论】:
标签: android url webview appcelerator appcelerator-titanium