问题web视图不加载 [英] Problem with webview not loading

查看:203
本文介绍了问题web视图不加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页视图糟糕的经历不加载网页,我请求。

I am having a bad experience with webview which does not load the web page which I request.

我无法加载谷歌或其他页面,网页视图。我已经把XML:

I cannot load google or any other page with a webview. I have put in xml:

<WebView  xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webview"
    android:layout_marginLeft="250px"
         android:layout_marginTop="80px"
    android:layout_width="180px"
    android:layout_height="160dip"
/>

然后我把在code:

I then put in the code:

mWebView = (WebView) findViewById(R.id.webview);
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.loadUrl("http://www.google.com");

这显示出来,说明该网页无法使用。

This shows up stating the webpage is not available.

我还添加了权限清单。

I have also added the permission to the manifest.

我有这样的应用程序中使用它加载YouTube网址罚款中的其他活动:

I have another activity within this application which loads a youtube url fine using:

startActivity(new Intent( Intent.ACTION_VIEW,
                                Uri.parse("http://www.youtube.com/watch?v=XS998HaGk9M")));// Starts an intent to watch the video

我不知道这可能是什么,真的需要这样的建议,因为我需要得到它的工作。

I'm not sure what this could be and really need advice on this as I need to get it working.

感谢

编辑:我也不能实际的仿真器本身内访问任何网页。通过在仿真器内的搜索栏搜索连接到谷歌时,此说同样的事情。

I also cannot access any webpage within the actual emulator itself. By searching in the search bar within the emulator this says the same thing when connecting to Google.

我不知道为什么会连接到YouTube与意图,而不是网页视图

I'm not sure why this would connect to youtube with an intent and not a webview

编辑:这甚至不是连接到YouTube现在,它说,与上述相同。这是搞砸了,因为我需要这个为明天我的项目工作。如果网页流量不断下降,这是不是很可靠。我可能要改变我和与Android的事情继续下去错误的工作设备。

This is not even connecting to youtube now, it says the same as above. This is messed up as I need this to work for my project tomorrow. If the webview keeps going down this is not very reliable. I may have to change the device I'm working with as with android things keep going wrong.

编辑:我刚回来后几个小时而不触及code或模拟器,当我运行应用程序的YouTube视频回,我可以在模拟器中进行浏览。但我仍然无法通过网页视图连接。非常不可靠的:(

I have just come back after a few hours without touching the code or the emulator and when I run the application the youtube video was back on and I can browse within the emulator. But I still cannot connect via webview. VERY UNRELIABLE :(

推荐答案

请确保您已为Internet访问权限

Make sure you have included Permissions for Internet Access

<uses-permission android:name="android.permission.INTERNET" />

这篇关于问题web视图不加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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