简体   繁体   中英

“Unable to start activity” after onStop?

I have a problem with life cycle of my code.

It runs well without noticeable errors, but when I stop the program (ie loading home screen) and return to the program again, it stops running showing error ("unable to start activity"). The log also shows this message: "java.lang.OutOfMemoryError: bitmap size exceeds VM budget"

I guess that this means my frame-to-frame bitmap animation. Is there a way to resolve this error? Please help.

Thanks in advance.

Hard to specify exactly without seeing what you are doing in code but it seems obvious that your bitmaps are hogging to much memory so you need to scale them down.

Here is an example: http://android-coding.blogspot.com/2011/06/reduce-bitmap-size-using.html

Use google and stackoverflow search to for further info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM