Problem in editText within a ListView [closed]

1

Hello,IcreatedalistofquestionswithinaListView,Icreatedalltheprogrammingquestions,I'mnotdoinganycomponentinthelayout.xml,itjusthasaframeLayout,butthemomentIclickonedittextitdoesnotletmetype,Iclickandthekeyboardcellphonepopsupanddisappearsquickly,doesanyoneknowwhatitcanbe?Andhowtosolve?

Followtheeditextcreationcode:

publicLinearLayoutcreateEditText(Stringquestion,intline,EditTexteditText){LinearLayoutlinearLayout=newLinearLayout(context);linearLayout.setOrientation(LinearLayout.VERTICAL);ViewGroup.LayoutParamslpView=newViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);ViewGroup.LayoutParamslpViewEdit=newViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);TextViewtv=newTextView(context);tv.setTextColor(Color.BLACK);tv.setText(question);tv.setLayoutParams(lpView);linearLayout.addView(tv);editText=newEditText(context);editText.setEnabled(true);editText.setInputType(InputType.TYPE_CLASS_TEXT);editText.setFocusable(true);editText.setMaxLines(10);editText.setEms(2);editText.setLayoutParams(lpViewEdit);linearLayout.addView(editText);returnlinearLayout;}

HereisthecodewhereI'mcallingthiscreationmethod:

editText=newEditText(context);frameLayout.addView(createEditText(id+"." + listaPergunta.get(position).getTxtPergunta(), lines, editText));
    
asked by anonymous 05.12.2016 / 17:52

1 answer

0

For the setInputType enter the value for the field type. Example field password, numeric field, text field and etc.

EditText edit = new EditTex(context);   
edit.setEnabled(true);
edit.setInputType(InputType.TYPE_CLASS_TEXT);
edit.setFocusable(true);
    
05.12.2016 / 19:32