Postby cooolmagic » Thu Aug 20, 2009 4:40 pm
try these steps..
1. Add webview to view hierarchy. Create WebView and add to a hidden ViewGroup (with visibility = INVISIBLE not GONE) in your onCreate().
2. Set webView.setDrawingCacheEnabled(true). Call loadURL.
3. Let first drawing pass happen. You can use a Handler and send 1 sec delayed message at end of onResume().
4. In your handleMessage:
- viewGroup.setBackgroundDrawable(aWhiteDrawable); // imp if page has not loaded anything yet
- Bitmap b = webView.getDrawingCache();
- viewGroup.setBackgroundDrawable(null); // remove background
Partager