I am using this code for getting the value of edittext in a list view.
View view = listview.getChildAt(position);
EditText text = (EditText)view.findViewById(R.id.myEditBox);
String contents = text.getText().toString();
But the problem is that when i scroll the list view ,position changes and i am getting a different result.i.e if i scroll,the element at fifth position gets at the top and its position becomes 0.Is there any remedy for that?
You will have to create an Adapter for your listview if you haven’t already done that, and on your adapter when you set your views add a textwatcher and report when the text is changed to your activity or fragment.
On your adapter:
On your activity
That way you don’t have to guess the position fo your edit text