通過Android市場,對於我的應用程序用戶報告了大量的不受支持的操作異常。堆棧跟蹤指向從webview代碼內部進行的drawPicture()調用。我確實在我的應用中使用了網頁瀏覽。Android硬件加速webview崩潰
我知道在HWA打開時不支持drawPicture(),但在這種情況下,調用來自webview內部。我需要採取哪些特殊步驟來確保webview不會使用此方法?
不幸的是,我一直無法重現這個問題,但肯定會被用戶看到。
堆棧跟蹤:
java.lang.UnsupportedOperationException
at android.view.GLES20Canvas.drawPicture(GLES20Canvas.java:753)
at android.webkit.WebView.drawCoreAndCursorRing(WebView.java:4128)
at android.webkit.WebView.drawContent(WebView.java:3797)
at android.webkit.WebView.onDraw(WebView.java:3862)
at android.view.View.draw(View.java:9286)
at android.view.View.getDisplayList(View.java:8749)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.getDisplayList(View.java:8747)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.draw(View.java:9289)
at android.view.View.getDisplayList(View.java:8749)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.getDisplayList(View.java:8747)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.getDisplayList(View.java:8747)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.draw(View.java:9289)
at android.widget.FrameLayout.draw(FrameLayout.java:419)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1923)
at android.view.View.getDisplayList(View.java:8749)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.getDisplayList(View.java:8747)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.draw(View.java:9289)
at android.view.View.getDisplayList(View.java:8749)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.getDisplayList(View.java:8747)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.getDisplayList(View.java:8747)
at android.view.ViewGroup.drawChild(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189)
at android.view.View.draw(View.java:9289)
at android.widget.FrameLayout.draw(FrameLayout.java:419)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1923)
at android.view.View.getDisplayList(View.java:8749)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:609)
at android.view.ViewRoot.draw(ViewRoot.java:1600)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1416)
at android.view.ViewRoot.handleMessage(ViewRoot.java:2046)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4123)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native Method)
這是一個有趣的錯誤。當WebView在硬件加速畫布上繪製時,它不使用drawPicture(),而是使用完全不同的代碼路徑。如果您能夠提出一個重複案例,請將其發送給我,我會將其轉發給WebView團隊。 – 2012-01-05 23:00:22
不知道爲什麼這是downvoted ... – BeRecursive 2012-01-05 23:02:45