简体   繁体   中英

Get value from textview in ListView Android

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

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()));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM