title: "Authorization Required" in webview
body: <p>I am trying to access a webpage after successfuly loging in, where i get the username and password (from the EditTexts in my app "user = (EditText) findViewById(R.id.user);" and "pass = (EditText) findViewById(R.id.pass);" ) and POST it to server.</p>
  
  <p>The problem is that the webview shows the text "Authorization Required.... " (after loging in successfuly) only on the phones/tablets that have android 4.2.2 but on 4.4.2, 4.4.4 and 5.0.1 works fine (shows the page intended).</p>
  
  <p>I am running out of ideas and need help. Chould you guys help me? Thank you in advance.</p>
  
  <pre><code> List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);
          nameValuePairs.add(new BasicNameValuePair("user", user.getText().toString()));
          nameValuePairs.add(new BasicNameValuePair("password", pass.getText().toString()));
  
          httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "utf-8"));
          httppost.addHeader("Authorization", "Basic BLA123BLA23BLA32343LSJ");
  
          // Execute HTTP Post Request    
          response = httpclient.execute();
  
         //WebView                    
                      webview_asd = new WebView(MainScreen.this);
                      webview_asd = (WebView) findViewById(R.id.webview_asd);
                      webview_asd.getSettings().setLoadsImagesAutomatically(true);
                      webview_asd.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
                      webview_asd.setWebViewClient( new WebViewClient() );
                      webview_asd.getSettings().setJavaScriptEnabled(true);
  
  
                      CookieSyncManager.createInstance (webview_asd.getContext());
                      CookieSyncManager.getInstance().sync();
  
                      cookies = ((AbstractHttpClient) httpclient).getCookieStore().getCookies();
  
                      if(cookies != null)
                      {
                          for(Cookie cookie : cookies)
                          {
                              cookieString = cookie.getName() + "=" + cookie.getValue() + "; domain=" + cookie.getDomain();                        
                              CookieManager.getInstance().setCookie(cookie.getDomain(), cookieString);  
                          }
                      }
  
                      CookieSyncManager.getInstance().sync();
  
                  webview_asd.loadURL(URL);   
                  webview_asd.setVisibility(View.VISIBLE);
  </code></pre>
  
  <p>The webview page shows's "Authorization Required. This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials(e.g., bad password), or your browser doesn't understand how to supply the credentials required."</p>
  
  <p><strong>Later edit:
  Just figured out that 4.2.2 doesn't support HTML5 and that's why i got this problem.</strong></p>