Error inflating class <unknown> which I know is a webview

无人久伴 提交于 2019-12-11 05:14:22

问题


I need help, I have an application published on the market using a webview to present information.. Every now and then i get error reports like this one:

http://pastebin.com/zQ16Sf2z

The error points to my inflation-line of my activity:

setContentView(R.layout.view);

Binary XML file line #22: Error inflating class <unknown> must mean

<WebView android:id="@+id/WebView" android:layout_width="fill_parent" android:layout_height="fill_parent"></WebView>

in my layout http://pastebin.com/MFAPawin

Please help me or give me a hint for a start in the right direction! This is a problem I have had for a long time and have not been able to solve.. Thank you!


回答1:


The culprit is the java.lang.OutOfMemoryError exception that is thrown when creating your layout. So in short- use less Memory. But seriously when you run out of memory all kinds of things will fail.

Without seeing any of your code my suggestion is that you may have a memory leak somewhere. It's hard to tell with seeing any code but check out:

http://android-developers.blogspot.co.uk/2009/01/avoiding-memory-leaks.html

for some tips that may help.




回答2:


It looks like your bitmap size exceeds VM budget (java.lang.OutOfMemoryError). You might look here, here or here for a solution.



来源:https://stackoverflow.com/questions/8244390/error-inflating-class-unknown-which-i-know-is-a-webview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!