How to set Multiple Langues support into android application -


hi doing 1 application here need enter edittext , data after button click need save in database,up here code working fine.but problm in activity listview have 10 languages if user select french,that time if enter data in edittext time need write data in edit text in french format , save data in data base french format..or else user select hindi means need write data in edit text in hindi format , save data in data base hindi format.but in app default languge english,please how have suggest me...

   language.class:     public class language extends activity {   relativelayout main,sub; public void setnotitle() {     requestwindowfeature(window.feature_no_title); }   float screenheight,screenwidth,screendensity;  textview heading;  button back;  private listview lv;  private edittext et;  private string listview_array[] = { "arabic", "dutch", "english", "french", "german",  "hindi", "italian", "japanese", "portuguese", "russian" };  private arraylist<string> array_sort= new arraylist<string>();  int textlength=0; @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);      setnotitle();      getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen);      displaymetrics displaymetrics = new displaymetrics();      getwindowmanager().getdefaultdisplay().getmetrics(displaymetrics);      screenheight = displaymetrics.heightpixels;      screenwidth = displaymetrics.widthpixels;      screendensity = displaymetrics.densitydpi;     setcontentview(r.layout.language);        lv = (listview) findviewbyid(r.id.listview01);          et = (edittext) findviewbyid(r.id.edittext01);          lv.setadapter(new arrayadapter<string>(this,          android.r.layout.simple_list_item_1, listview_array));           et.addtextchangedlistener(new textwatcher()          {          public void aftertextchanged(editable s)          {                                                                          // abstract method of textwatcher interface.          }          public void beforetextchanged(charsequence s,          int start, int count, int after)          {          // abstract method of textwatcher interface.          }          public void ontextchanged(charsequence s,          int start, int before, int count)          {          textlength = et.gettext().length();          array_sort.clear();          (int = 0; < listview_array.length; i++)          {          if (textlength <= listview_array[i].length())          {          if(et.gettext().tostring().equalsignorecase(          (string)          listview_array[i].subsequence(0,          textlength)))          {                                                                                                                          array_sort.add(listview_array[i]);                                                                                                          }                                                                                          }                                                                          }          lv.setadapter(new arrayadapter<string>          (language.this,          android.r.layout.simple_list_item_1, array_sort));          }          });           lv.setonitemclicklistener(new onitemclicklistener() {              public void onitemclick(adapterview<?> arg0, view arg1,                     int arg2, long arg3) {                 // todo auto-generated method stub                  string                    if (language.equals("english us")) {                  } else if (language.equals("francais")) {                  } else if (language.equals("espanol")) {                  }             }         }); } } 


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -