开发者

show webpage from webview

i am able to open google.com from emulator browser.but in coding i am not able to show any thing.that is my code.i already write internet permission.any extra emulator setting?

public class TestActivity extends Activity 
{
    WebView webview;
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstan开发者_开发百科ceState);
        setContentView(R.layout.main);

        System.setProperty("http.proxyHost","192.168.0.2");
        System.setProperty("http.proxyPort","8080");

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


open CMD prompt and go to SDK path...

D:\Android Setup\android-sdk-windows\tools

write down this following command...

emulator -avd "name" -dns-server 8.8.8.8
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜