目的:跑一个截获网页图片的任务(让webview一直在后台运行,不显示activity的WebView, 且不影响用户的正常行为)我对activity设置了不可见(android:theme="@android:style/Theme.NoDisplay")
然后想获得WebView的Bitmap(通过drawcache获得且已设置setDrawingCacheEnable(true))
但是一直失败提示“can't get the viewWidth after the first layout”
我试了设置WebView.setVisibility(view.GONE)也不行;请问各位大牛,该如何在webview后台运行的情况下取得webview的drawcache?