开发者

show webpage from webview

开发者 https://www.devze.com 2023-04-12 09:56 出处:网络
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?

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

精彩评论

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