机器人的WebView网络连接问题的代理,因为? [英] android WebView internet access problem, because of proxy?

查看:109
本文介绍了机器人的WebView网络连接问题的代理,因为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的问题:

仿真器(安卓2.2),能够通过浏览器访问互联网。 (我是在一个代理,所以我首先设置代理服务器)

Emulator(Android 2.2) is able to access internet through browser. (I am behind a proxy so i set the proxy first)

但是当我创建一个web视图的应用程序,好像它不能由web视图访问互联网。

but when i create a webview app, seems like it can not access the internet by webview.

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

设置。所以,恐怕是因为代理的。

is set up. So I am afraid it's because of the proxy.

任何线索?谢谢你。

推荐答案

尝试添加在OnCreate中()

Try adding In OnCreate()

WebView.enablePlatformNotifications();

和添加以下权限清单

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

这应该使您的web视图来访问它所需的代理信息。您可能需要重新启动模拟器(希望不是)。

This should enable your webview to access the proxy info it needs. You may need to restart your emulator (hopefully not).

这篇关于机器人的WebView网络连接问题的代理,因为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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