You are Great! the code just works flawlessly. I did a mistake initially by passing language name as "bn-rIN", however it should be only "bn" in the array list. Thanks Mate for the tutorial and demo :-)
@TechGuyNaresh3 жыл бұрын
Glad to help you!
@sat_talk3 жыл бұрын
Thanks bro.. just want confirmation, likewise can I use Marathi, Gujarati, any language?
@TechGuyNaresh3 жыл бұрын
Happy that you liked it, yes you can add any languages as long as you have the translations. Just maintain the string values syntax like for Hindi -> value-hi and for Telugu -> value-te etc...
@tampankami71854 жыл бұрын
i want implement this code into fragment not at mainactivity how?
@TechGuyNaresh4 жыл бұрын
Hi tampan, I don't have played with fragments, but you can try onAttache() set language preference like "myPreference.setLoginCount(languageList[spinner.selectedItemPosition])".
@tarikbarucija95243 жыл бұрын
Why does this not work on android version 5.0
@TechGuyNaresh3 жыл бұрын
Android minSdkVersion changed from 21 to 24. What this means, is that Android 5 and 6 are not supported anymore, and Android 7+ is required.
@MarioEugenioExcel4 жыл бұрын
How to change the language in all activities?
@TechGuyNaresh4 жыл бұрын
You have to use following function in all activities: override fun attachBaseContext(newBase: Context?) { myPreference = MyPreference(newBase!!) val lang:String = myPreference.getLoginCount() super.attachBaseContext(MyContextWrapper.wrap(newBase, lang)) }
@TechGuyNaresh4 жыл бұрын
Or you can refer my source code, link is in discription.