I assume your ListView has a ListAdapter (probably a BaseAdapter?).

In your Adapter's getView(...) method, you have a position parameter. The 
position is the index into your array-list of data that you'd like to show 
in the correct list-item-view. 

You get your data-item from the Adapter given the position 
(getItem(position)).
You create your view, if your convertView is not yet set. In that view you 
have your EditText/TextViews and you assign the data from the data-item to 
these views.
Use the method 'setTag(...)' of your list-item-view and set the data-item 
as the list-item-view's tag.

When you convertView was null, you had to create you list-item-view. When 
creating this, set a TextWatcher to your EditText that allows you to be 
notified when the user changes the text.

In your TextWatcher, get hold of the list-item-view of your EditText. Get 
the tag from the list-item-view (getTag(...) method) and that will be the 
data-item associated with that list-item-view. Update the changed text from 
the EditText in your data-item.

When saving the data to the server, get hold of you Adapter, use getCount() 
and getItem(...) calls to get all the data-items. It should contain the 
updated EditText texts.


On Friday, February 19, 2016 at 5:17:24 AM UTC-5, NIWEWE David wrote:
>
> Hi! I have been working on something for more than 2 days, but only met 
> roadblocks all around. 
> I have a listView that is updated by a JSON array from the server, Each 
> item is composed by 
> 3 TextViews where one is not visible to the user and a EditText that is to 
> be updated by the user. 
> What I want to do is when the user has finished inputting data in all 
> EditText in that list, loop through
> all Items of the listviews getting their values, put them into a Hashmap 
> array, change the hashmap 
> into JSON and send the JSON to PHP. All works very fine for the visible 
> Items on the screen. But 
> I have failed to get item visible when you scroll. Any help?     
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/afa64fb3-d08a-4e5b-8fe6-6eef7823f818%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to