Localhost connection does not work Android webview

1

If I try to go directly to the localhost of the server through Chrome I can enter but through an application the page is blank, follow the code:

public class WebActivity extends Activity {

    private WebView webView;

    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.webcontent);

        webView = (WebView) findViewById(R.id.webView);

        webView.getSettings().setJavaScriptEnabled(true);

        webView.loadUrl("192.168.1.66/sir1415/teste/teste.html");


    }
    
asked by anonymous 16.02.2015 / 21:47

1 answer

1

I was able to find out the solution, when using webview to localhost you have to use the port, even if you do not need the browser in the webview you need always, ie the address looks like this: link

    
17.02.2015 / 10:24