4

I must develop an Android Application that open certain urls in a Webview , but i have some problem :

  1. When i try to open mobile site ( m.site.something.it ) an intent start , wondering which browser i want use to open the web site.

    I want force the opening of each site in a webview ( NO broweser ) .

  2. I need to intercept all HttpRequest and HttpResponse all , how i can do this ?

I'm developing for Android 6.0 , to post olds using deprecated method .

EDIT

        Intent intent = getIntent();
        String urlToLoad = intent.getStringExtra("url");

        // webView.getSettings().setAppCacheEnabled(false);

        WebView webview = (WebView) findViewById(R.id.wv);
        webview.getSettings().setLoadWithOverviewMode(true);
        webview.getSettings().setUseWideViewPort(true);
        //THIS SHOULD FORCE OPEN SITE IN WV, BUT NOT WORK
        webview.getSettings().setUserAgentString("Android");

        webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);

        webview.loadUrl(urlToLoad);

***** EDIT 2 *****

Another problem is : 2. I need to intercept all HttpRequest and HttpResponse all , how i can do this ?

1 Answers1

-1

Add this on your code:

myWebView.setWebViewClient(new WebViewClient());
Bibi Bizio
  • 36
  • 6