Edittext problem within Listview

Asked

Viewed 51 times

0

Hello, I’m having trouble in edittext inside the listview, it does not let me type and is giving these errors.

Follows errors below:

W/IInputConnectionWrapper: beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper: getSelectedText on inactive InputConnection
W/IInputConnectionWrapper: endBatchEdit on inactive InputConnection
W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper: getTextAfterCursor on inactive InputConnection

Follows my code:

editText = new EditText(context);
editText.setLines(qtdeQuestoes);
editText.setInputType(InputType.TYPE_CLASS_TEXT);
frameLayout.addView(editText);
  • vc ta put Edit text dynamically at runtime? or it ta in xml ?

  • 2

    Vinicius, really the ListView is a component that has many problems, not worth the effort to use it for more complex layouts. I strongly recommend using the RecyclerView for this type of situation. In my opinion the ListView has only utility for very simple layouts.

  • I am creating dynamically. So Wakin is q the project is already too big, will there be anything msm q solve this problem? I thank you already.

  • Vinicius, also had exactly the same difficulty with Listview and Edittext. The solution I used was to switch to Recyclerview, which I suggest to you. I believe it will be worth the effort to implement Recyclerview in your project

  • I have never used Recyclerview, it requires many changes?

  • Vinicius, I believe not, the Adapter of RecyclerView is an evolution of Adapter of ListView, with a few caveats: you are required to implement the standard ViewHolder (what is good) and the RecyclerView does not deal item selection (you will have to do it on the outside). Other than that, there is not much difference. I won’t put an answer to how to use it, as there are several questions here at Stackoverflow with details.

  • I did it with Recyclerview, it worked, vlw!

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.