Android WebView JellyBean -> Should not happen: no rect-based-test nodes found

前端 未结 8 1594
南旧
南旧 2020-11-30 20:32

My application is using a lot of webviews which are lying in fragments which are hold by a ViewPager.

Whenever i swipe through the app on my Galaxy Nexus with Jelly

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 21:28

    Have the same problem with JellyBean and ViewPager + fragments that contains WebViews. And all OK with the same code running on Android 2.2, so I think this is a bug in JB WebView implementation.

    On JB only the first shown fragment with WebView works right, without errors "Should not happen .." in the log, and getHitTestResult() calls returns correct values. Swiping to the next pages, I got errors in log and getHitTestResult() returns only zeroes and nulls.

    Now I found only one solution to create fragments with empty containers and create WebViews, setup they and load data only when current fragment becomes active in the ViewPager. In this case WebView works as needed. But, unfortunately, this completely breaks an idea of smooth swiping pages in the ViewPager.

    Have the last idea, tomorrow will try to replace ViewPager's fragments to compound views. Little chances, but I'll let you know if results will be successful.

提交回复
热议问题