Search code examples
androidandroid-layoutscreen-density

Defining only one screen density qualifier?


What happens when I define dimens.xml file only under values-hdpi directory in addition to the default values directory? does the system use it for higher densities as well (xhdpi, xxhdpi, ..) or does it use the default one?


Solution

  • Android OS looks in the correct folder for dimens.xml, so if you are on an hdpi resolution device, Android OS will first look for a dimens.xml file in the values-hdpi, if it couldn't found it, it will go straight for the default dimens.xml file in the default values folder. If it was also not found, the system will look for the most relevant one.