[英]Titanium WebView - Is there a way to stop it opening a system app?
I'm working on a very simple app at the moment that has a tabgroup which open's up various webviews containing different URLs. 目前,我正在开发一个非常简单的应用程序,该应用程序具有一个选项卡组,可以打开包含不同URL的各种Web视图。
One of the webviews is a google maps link, on the device I am using it has the Google Maps App installed. Webview之一是google maps链接,在我使用的设备上,它已安装了Google Maps App。 Instead of opening the link in the google maps website, it opens up the link in the App instead. 与其在Google Maps网站中打开链接,不如在应用程序中打开链接。 If I test the app in a simulator without the google maps app installed, the webview will load the website version instead. 如果我在未安装google maps应用程序的模拟器中测试该应用程序,则webview将改为加载网站版本。
Is there a way to stop the device from using the system app and force it to use the website instead? 有没有一种方法可以阻止设备使用系统应用程序并强制其使用网站? So far I have been unable to find any information. 到目前为止,我一直找不到任何信息。
Thanks. 谢谢。
I'm kind of surprised that the WebView is doing what you're describing. 我对WebView所做的事情感到惊讶。 I would expect it to directly load the contents of the URL you've provided, regardless of whether another app is registered for that URL scheme. 我希望它可以直接加载您提供的URL的内容,而不管是否已为该URL方案注册了另一个应用程序。 But I'll take your word for it. 但我会相信你的。
I have two ideas on this: 我对此有两个想法:
could you use ti.map instead of a google maps URL? 您可以使用ti.map代替Google Maps URL吗? I'm not sure what your map contains; 我不确定您的地图包含什么内容; this may not be practical for you 这可能对您不切实际
could you use HTTPClient to retrieve the HTML from the google maps URL, and then call WebView.setHtml() with that HTML? 您可以使用HTTPClient从Google Maps URL检索HTML,然后用该HTML调用WebView.setHtml()吗? I would imagine you might have to add a element to the HTML to get all the relative URLs in the page to work... 我想您可能必须向HTML添加元素才能使页面中的所有相对URL正常工作...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.