Android Drawable hdpi xhdpi mdpi ldpi concept [dup

2019-09-20 06:29发布

问题:

This question already has an answer here:

  • Drawable-hdpi, Drawable-mdpi, Drawable-ldpi Android 2 answers

I am having one query in drawable concept. I have images of fixed sizes and i have put them in drawable folder. I have deleted my other folders such as drawable-hdpi, mdpi, ldpi, xhdpi from eclipse project and have made the APK of my project.

My question is that will my application(generated apk) work on all the devices and tablets( i am not concerned about how the UI will look)? Or can it create ResourceNotFound Exception on some devices/tablets as there are not all drawable folders present?

回答1:

The folders without any qualifiers (layout, drawable, raw, values etc.) are the default folders. Android looks for each resource in them if it isn't found in the folders that qualify for that device. If you have a copy of any resource in them, you should never get a ResourceNotFound exception for that particular resource, unless the manufacturer introduces a bug into their ROM.



回答2:

As long as you have a drawable folder then when OS searches for the others and doesn't find them, it will defualt to the only drawable folder available.