Setting text to array of edit text android -
i have array of text dynamically generated , when user clicks button , need each character of particular string displayed in each text.
for eg. text looks like,
where each'-' represents text , when user clicks button , want string/character populated each time . for. eg, when user clicks button first time, want character 'a' displayed .so, text array must lik
a - -
and when user clicks second time, must populate 'b' in second text field, so, output must be,
a b -
and values 'a' , 'b' dynamic. have tried using below code,
edittext[] edittext = new edittext[dynamiclen]; (int n = 0; n < dynamiclen; n++) { edittext[n] = new edittext(puzzlewithhint.this); edittext[n].setlayoutparams(new viewgroup.layoutparams (viewgroup.layoutparams.wrap_content, viewgroup.layoutparams.wrap_content)); edittext[n].setfocusable(true); edittext[n].setimeoptions(edittext[n].getimeoptions() | editorinfo.ime_action_done); edittext[n].setinputtype(inputtype.type_class_text); edittext[n].settextcolor((color.parsecolor("#e3732d"))); edittext[n].settypeface(null, typeface.bold); edittext[n].settext(ansstring); edittext[n].setfilters(new inputfilter[]{new inputfilter.lengthfilter(1)}); alleds.add(edittext[n]); gl.addview(edittext[n]); } edittext[1].gettext().clear(); edittext[2].gettext().clear(); hintcount++; log.d(tag, "hintcc" + hintcount);
any great !!
Comments
Post a Comment