我的android应用程序正在打开一个webview,当我点击webview中的图像时,它显示了这个错误--->网:err_unknown_url_scheme [英] My android application is opening a webview in which when I click on the image in webview it shows this error---> net:err_unknown_url_scheme

查看:303
本文介绍了我的android应用程序正在打开一个webview,当我点击webview中的图像时,它显示了这个错误--->网:err_unknown_url_scheme的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

My android application is opening a webview in which when I click on the image in webview it shows this error---> net:err_unknown_url_scheme





for eg



让我们说我正在加载facebook .com在我的Android应用程序中。该网站开放完美我可以访问所有内容,但当我点击Facebook上的任何图像。它显示:



for e.g

let's say I am loading facebook.com in my android app. The site is opening perfectly fine I can access everything but when I click on any image on Facebook. It shows :

net:err_unknown_url_scheme





我尝试了什么:





What I have tried:

Quote:

打开应用程序中的超链接我使用了以下代码:



To open the hyperlinks within the application I have used following code:

public class GeoWebViewClient extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {

            if(url.toLowerCase().startsWith("http") || url.toLowerCase().startsWith("https") || url.toLowerCase().startsWith("file"))
            {
                view.loadUrl(url);
            }
            else
            {
                try
                {
                    Uri uri = Uri.parse(url);
                    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                    startActivity(intent);
                }
                catch (Exception e)
                {
                    Log.d("JSLogs", "Webview Error:" + e.getMessage());;
                }
            }
            return (true);
        }







Quote:

我尝试使用搜索后的浏览器网址点击相同的图片 -



https://www.zomato.com/ncr/ wood-box-cafe-delhi-university-gtb-nagar / menu#tabtop



这是我在我的应用中使用webview点击同一图像时得到的结果



zomatobranchsdk:// open?link_click_id = 5912449135

I tried to click the same image using browser URL that came after the search is--

https://www.zomato.com/ncr/wood-box-cafe-delhi-university-gtb-nagar/menu#tabtop

and this is what I get when I click the same image using webview in my app

zomatobranchsdk://open?link_click_id=5912449135

推荐答案

引用:

url是----无法加载zomatobranchsdk:// open?link_click_id = 5912449135的网页,因为:net :: ERR_UNKNOWN_URL_SCHEM

url is ---- the webpage at zomatobranchsdk://open?link_click_id=5912449135 could not be loaded because: net::ERR_UNKNOWN_URL_SCHEM



据我所知, zomatobranchsdk:// open?link_click_id = 5912449135 不是网址。这可能是错误的原因。
解决方案的第一步是找到正确的URL。


As far as I know, zomatobranchsdk://open?link_click_id=5912449135 is not an url. This may be the reason of error.
First step to solution is to find what is the correct URL.


这篇关于我的android应用程序正在打开一个webview,当我点击webview中的图像时,它显示了这个错误--->网:err_unknown_url_scheme的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆