Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)

(gtxtreme123) #1

Multiple qualifiers


Multiple qualifiers


You may have noticed that the New Resource File dialog has many available qualifiers. You can put
more than one qualifier on a resource directory. When using multiple qualifiers on directories, you
must put them in the order of their precedence. Thus, values-es-w600dp is a valid directory name,
but values-w600dp-es is not. (When you use the New Resource File dialog, it correctly configures the
directory name for you.)


Create a directory for a wide-screen Spanish string. It should be named values-es-w600dp and have
a file named strings.xml. Add a string resource for crime_title_hint to values-es-w600dp/
strings.xml (Listing 18.5).


Listing 18.5  Creating a wide-screen Spanish string resource
(values-es-w600dp/strings.xml)




Introduzca un título significativo y memorable para el crimen.


With your language set to Spanish, run CriminalIntent to confirm your new alternative resource
appears on cue (Figure 18.13).


Figure 18.13  Spanish wide-screen string resource

Free download pdf