John
John

Reputation: 57

Localizing Images Android Studio

I have some problem when I trying to follow a tutorial to create a localization app: After I created all the folders and place the flag images, I run the app and expect to see the greeting message and corresponding flag for the locales; here is the problem:

picture_1

The flag should change to Germany flag. (I set England flag as default)

This is the error message when I click the flag(Yes, the flag is a button.) picture_2

This is my res folder structure: picture_3

This is my res directory: image_4

Textview is working fine, only problem is the flag image won't change with the location. Can somebody show me where the problem is?

Upvotes: 0

Views: 1102

Answers (1)

Chirag Chavda
Chirag Chavda

Reputation: 556

You have to mention DPI into the name of your drawable folder after language code. For Ex, drawable-de-rDE-hdpi. Otherwise it will not find resources.

Upvotes: 2

Related Questions