vendredi 24 octobre 2014

Set edittext inputtype created dynamically - causes errors


Vote count:

0




I have a problem with dynamically created EditText. I create dialog, with some elements, and also EditText. I want it to have InputType only number. So I try doing that like:



EditText itemsCount = new EditText(this);
itemsCount.setInputType(InputType.TYPE_NUMBER_VARIATION_NORMAL);
lila.addView(itemsCount);


lila is LinearLayout, where I am adding more views. Aaand that's where weird behavior begins. On lenovo tablet I cannot enter any data. On my S3 i can enter data, hovever I cannot use backspace... When I will add EditText without determining InputType, everything works as it should, but user can also enter text, and that's what i do not want... Any ideas what can causing those bugs?



asked 23 secs ago







Set edittext inputtype created dynamically - causes errors

Aucun commentaire:

Enregistrer un commentaire