Android.view.InflateException:Binary XML file Line #95: The Error inflating class (out of memory). Abnormal

Source: Internet
Author: User

Android.view.InflateException:Binary XML file Line #95: The Error inflating class (out of memory).

In fact, because the out of memory, resulting in XML is not possible to be inflated successfully, so the activity of the OnCreate method,

Setcontentview (r.layout.***) is not likely to be successfully invoked.

He appeared in I have multiple instructional animations, and the animated animation that is based on the Imageview,imageview background is a large picture of our project.

The error situation is: Open an activity, the activity is only used to play an animation. Then manually back, turn off activity (finish). Second activity, the second activity bound layout is different from the first one, and another animation is played. Manually back, turn off activity.

And so on, the android.view.InflateException:Binary XML file line #95 will appear after multiple runs: Error inflating class.

caused by out of memory.

At first I did not want to understand, every time my activity is finish, how can not memory.

So the Internet to find the answer, on the dear StackOverflow found the great God of the comments, (the Great god please: http://stackoverflow.com/questions/7536988/ android-app-out-of-memory-issues-tried-everything-and-still-at-a-loss/7576275), originally raised the question the everything, haha.


In fact, because we do not recycle resources manually, in other words, Java garbage collection mechanism is not so smart, we finish off, but the relevant resources in it may not be recycled. It's possible that he thinks he's smart enough to stay and wait for our next use. So we need to manually release large resources such as ImageView in the OnStop method.

Android.view.InflateException:Binary XML file Line #95: The Error inflating class (out of memory). Abnormal

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.