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 ?
– Jasar Orion
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 theRecyclerView
for this type of situation. In my opinion theListView
has only utility for very simple layouts.– Wakim
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 da Mata
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
– LeoSantana
I have never used Recyclerview, it requires many changes?
– Vinicius da Mata
Vinicius, I believe not, the
Adapter
ofRecyclerView
is an evolution ofAdapter
ofListView
, with a few caveats: you are required to implement the standardViewHolder
(what is good) and theRecyclerView
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.– Wakim
I did it with Recyclerview, it worked, vlw!
– Vinicius da Mata