开发者

OutOfMemory Exception on Android

I'm using in my applic开发者_JS百科ation an external jar-library, which is working with bitmaps. This causes an out of memory exception in my application. This kind of problem is described in following issue: http://code.google.com/p/android/issues/detail?id=8488

Once OOME occurs, an activity crashes, application is still going runing, memory will be free, but the wifi-connection will be lost.

Is there the way to get memory free before activity crashes? Probably, I should say, I have no access to bitmaps, which are using by the library. I also tried to call System.gc() in onPause and onDestroy, but that doesn't help.

Why would be memory free when activity crashes?

What did happen with wi-fi-connection?

Thank you

upd

this library is osmdroid


Try to extend Application class with your own (need to be declared AndroidManifest.xml). In those Application class there's one method Application.onLowMemory() - which has to be called on low memory. You can override this method and try to release unnecessary resources. Probably it will be usefull.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜