I'm following this guide to create a listview with textviews and eddittexts in it.
http://www.webplusandroid.com/creating-listview-with-edittext-and-textwatcher-in-android/
When I try to get values from listview items, I get only textviews values. It seems impossible getting text from the edittext based on listview position.
I use lv.getItemAtPosition(0).toString())
to retrieve values
Asked
Active
Viewed 452 times
0

Bitle Apps
- 148
- 8
-
1Please post how you are getting TextViews result. – Rahul Oct 15 '16 at 18:18
-
add your code plz – Neelay Srivastava Oct 15 '16 at 18:50
-
I added my code, the rest of the code with explanation is on the link – Bitle Apps Oct 16 '16 at 17:52
-
The linked post uses an Adapter... Why are you trying to access the views from the ListView itself? – OneCricketeer Oct 16 '16 at 17:56
-
You possibly could follow this post, then maybe use `findViewById`, for example, on the row view to get the correct view. http://stackoverflow.com/questions/257514/android-access-child-views-from-a-listview – OneCricketeer Oct 16 '16 at 17:59
-
In this way I'm getting the correct view, but I still can't receive EditText's text – Bitle Apps Oct 16 '16 at 18:14
1 Answers
0
Following: Android: Access child views from a ListView
int wantedChild = 1;
View wantedView = listview.getChildAt(wantedChild);
mEditText = (EditText) wantedView.findViewById(R.id.edittext);
Log.d("result",(mEditText.getText().toString()));