title: Android. How to set image on ImageView from WebView?
body: <p>I am using WebView to submit form values(I do not have access to API). 
  Webview is invisible. User will fill just EditTexts. Webview fields will be filled using Javascript. The problem I have is CAPTCHA image. Web form has PNG image which contains CAPTCHA numbers. </p>
  
  <p><img src="https://i.stack.imgur.com/aUDaM.png" alt="enter image description here"></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;img id="captcha_img" src="/service/INNCaptcha"&gt;
  </code></pre>
  
  <p>I want to take captcha image from WebView, and set it to ImageView. I tried this code:</p>
  
  <pre><code>webview.getSettings().setJavaScriptEnabled(true);
          webview.setWebViewClient(new WebViewClient() {
              @Override
              public void onPageFinished(WebView view, String url) {
                  String javascript = "javascript: var form = document.getElementsByClassName('form');"
                          + "var body = document.getElementsByTagName('body');"
                          + "body[0].innerHTML = form[0].innerHTML;;";
                  view.loadUrl(javascript);
                  webview.setVisibility(View.VISIBLE);
  
                  //THIS PIECE OF CODE RETURNING NULL BITMAP
                  view.buildDrawingCache();
                  Bitmap bmap = ivCaptcha.getDrawingCache();
                  ivCaptcha.setImageBitmap(bmap);
              }
          });
  </code></pre>
  
  <p>Result: BitMap is null. I think I should identify exactly which image(PNG) I want to show. So my question is how to set image on ImageView from WebView in this case?</p>