java - How to automatically display a foreign keyboard instead of default English keyboard on the type panel? -


i'm making questions , answers game in language other english. questions in nepali (similar indian) , user needs type answers in same script. when run app english keyboard gets displayed , i've switch nepali keyboard before typing. there anyway when user taps type panel, automatically displays nepali keyboard instead of english (as english keyboard primary keyboard in every phone)?

upon searching on net found this:

private void showinputmethodpicker() {     inputmethodmanager imemanager = (inputmethodmanager) getapplicationcontext().getsystemservice(input_method_service);      if (imemanager != null) {         imemanager.showinputmethodpicker();     } else {         toast.maketext(this, r.string.not_possible_im_picker, toast.length_long).show();     } } 

but i'm not sure does. please help!

you can do, in activity want have keyboard in different language. if have many activities want have keyboards in language.

    resources res = context.getresources();     displaymetrics dm = res.getdisplaymetrics();     android.content.res.configuration conf = res.getconfiguration();     conf.locale = new locale(language_code.tolowercase());     res.updateconfiguration(conf, dm); 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -