Skip to content Skip to sidebar Skip to footer

Incorrect Read String Directory When Set String From Xml

i change default local language, but in android 7 after change configuration to landscape and portrait again and after than open page strings that was set in xml layout read string

Solution 1:

when you change configuration to landscape you should have another layout with same name, designed for that and place same text in that.

Solution 2:

Amazing solution

in following line of code i used from global context

 G.context.getResources().updateConfiguration(config, G.context.getResources().getDisplayMetrics());

and after that changed rotation to landscape and again to portrait, @string/test that used in xml layout not worked correctly and 'test' showed, instead of showing persian word 'سلام' .

BUT NOW

i just removed global context that filled in Application class

getResources().updateConfiguration(config, getResources().getDisplayMetrics());

And finally, this problem was solved :)

Post a Comment for "Incorrect Read String Directory When Set String From Xml"