Refresh activity/ImageView?
<p>In my first activity I have a button and a webview and when I click on the button it opens a new activity with the content of the webview in an imageview. (I transform the webview in bitmap and set the imageview with this bitmap).</p>

<p>The problem is when I click on the button for the first time, nothing happen, my screen stays white. But if I come back in the first activity and reclick on the button the imageview is well displayed.</p>

<p>Why in the first time wasn't the imageview  displayed? Do I need something like to refresh my second activity or Imageview?</p>

<p>WebViewActivity.java</p>

<pre><code>public class WebViewActivity extends Activity {

    private WebView webView;
    ImageView imageView;
    Button button;


    public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.webview);

       webView = (WebView) findViewById(R.id.webView1);
       webView.getSettings().setJavaScriptEnabled(true);
       String customHtml = "&lt;BODY BACKGROUND=\"pic_10.jpg\"&gt;&lt;BODY&gt;&lt;div style=\"position: absolute; bottom: 0; width: 100%\"&gt;&lt;div style=\"padding:24px 0 0;margin:0;height:40px;background:transparent;position:relative;\"&gt;&lt;a href=\"http://www.amazon.com\" style=\"padding:0 140px 0 0;margin:0;height:40px;display:block;text-decoration:none;overflow:hidden;background:#fff;\" target=\"_blank\"&gt;&lt;span style=\"padding:0 0 0 40px;margin:0;display:block;overflow:hidden;background:transparent url(http://ads.gumgum.com/com/gumgum/tests/amazon.png) no-repeat scroll left center;\"&gt;&lt;p style=\"padding:0;margin:0;font:bold 12px/16px Arial;color:#000;text-decoration:underline;display:block;height:16px;overflow:hidden;text-align:left;padding:2px 0;word-wrap:break-word;\"&gt;HBase Administration Cookbook&lt;/p&gt;&lt;p style=\"padding:0;margin:0;font:italic 12px/16px Arial;color:#c60;text-decoration:none;display:block;height:16px;overflow:hidden;text-align:left;word-wrap:break-word;\"&gt;www.amazon.com&lt;/p&gt;&lt;/span&gt;&lt;span style=\"position:absolute;bottom:0;right:70px;overflow:hidden;\"&gt;&lt;img src=\"http://ecx.images-amazon.com/images/I/41OEZDHmUoL._SL75_.jpg\" style=\"border:none;max-width:64px;*width:64px;height:64px;\"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;";


       webView.loadDataWithBaseURL("file:///android_asset/", customHtml , "text/html", "utf-8", null);

       button = (Button) findViewById(R.id.btnChangeImage);

    }

    public void sendMessage(View view) {

           webView.setWillNotCacheDrawing(false);
           webView.destroyDrawingCache();
           webView.setDrawingCacheEnabled(true);
           webView.measure(MeasureSpec.makeMeasureSpec(480, MeasureSpec.EXACTLY), 
                    MeasureSpec.makeMeasureSpec(800, MeasureSpec.EXACTLY));
           webView.layout(0, 0,  webView.getMeasuredWidth(),  webView.getMeasuredHeight());


            webView.buildDrawingCache(true);
        Bitmap bmap = Bitmap.createBitmap(webView.getDrawingCache());
        webView.destroyDrawingCache();
        //imageView.setMaxHeight(55);
        //imageView.setMaxWidth(20);
        Bitmap bmap_New = scaleDownBitmap(bmap,400,this);
        Intent intent = new Intent(this, ImageViewActivity.class);
        intent.putExtra("BitmapImage", bmap_New);
        startActivity(intent);
    }

     public static Bitmap scaleDownBitmap(Bitmap photo, int newHeight, Context context) {

         final float densityMultiplier = context.getResources().getDisplayMetrics().density;        

         int h= (int) (newHeight*densityMultiplier);
         int w= (int) (h * photo.getWidth()/((double) photo.getHeight()));

         photo=Bitmap.createScaledBitmap(photo, w, h, true);

         return photo;
         }
</code></pre>

<p>ImageViewActivity.java</p>

<pre><code>    public class ImageViewActivity extends Activity {

    ImageView imageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image_view);

        imageView = (ImageView) findViewById(R.id.imageView1);
        Intent intent = getIntent();
        Bitmap bmp = (Bitmap)intent.getParcelableExtra("BitmapImage");
        imageView.setImageBitmap(bmp);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_image_view, menu);
        return true;
    }

}
</code></pre>

<p>I don't know if it is linked but when I start my application I have this in my catlog :</p>

<pre><code>E/chromium(32671): external/chromium/net/disk_cache/stat_hub.cc:190: [1214/103321:ERROR:stat_hub.cc(190)] StatHub::Init - App com.example.androidtestadserver isn't supported.
</code></pre>
