Sometime we need device's language.
Android provide class 'Locale'
Example
- Log.e("lng",language);
- if(language.contains("ko"))
- in korean
- else{
- another language
- }
Line 1 : Get country and language
Line 2 : Get language
Line 3 : show log
Line 4 : 'ko' mean korean. (english is 'en')
Line 6 : another language.
No comments:
Post a Comment