java - Setting a locale for textviews in fragment -


i want set locale single text view . means textview shown in language (in example french) unfortunately not working. while not error, nothing happens.

 locale locale = new locale("fr");  maintext.settextlocale(locale); tried updating confguirations , same thing . nothing changes .   locale locale = new locale("fr"); configuration config = new configuration(); config.locale = locale; getactivity().getresources().updateconfiguration(config,     getactivity().getresources().getdisplaymetrics()); maintext.settextlocale(locale); 

i tried doing in normal activities , worked fine .

setting text locale via settextlocale specifies type of font use render text. locale applied directly underlying paint object used render font on screen. here's documentation call: http://developer.android.com/reference/android/graphics/paint.html#settextlocale(java.util.locale)

changing locale directly through configuration file apply locale change across entire application. not want.

you have explicitly specify french text use view.


Comments