android.view.InflateException: Binary XML file line #2: Error inflating class

At runtime, Android resize’s images based on need (based on the screen size and resolution). It uses Bitmap’s for doing the resizing internally. Which, obviously, is very memory intensive (kinda allocates memory like crazy). One quick way to fix such issues can be, that you copy all drawable files to drawable-ldpi, mdpi, hdpi folders. This way android will just pick up the files from these folders and not resize them.

Its a random kind exception, a real pain to fix.

Leave a Comment