This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Android and the fly likes Update data in a Listview Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Update data in a Listview" Watch "Update data in a Listview" New topic
Author

Update data in a Listview

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Hi all, In my application I am getting continuous data through socket connection. I want to display this data in listview which will update automatically as data changes which is coming from socket connection. I have following code:




Now using this there is update only in one row. Means suppose server send one record then it is displayed as



EmpId Name MobNo
1 Pramod 789




But suppose after some time socket receive new record then it must be added as



EmpId Name MobNo
1 Pramod 789
2 Ulf 456 //here this record is added


If next time record comes with same EmpId then existing records value must change as


EmpId Name MobNo
1 Rob 456 //this time this empId record is changed.
2 Ulf 456




But in my exising code data is updated only in one row. Means it creates only one row and if data changed then it is reflected in that row. How to solve this issue? Thanks in advance

Life is easy because we write the source code.....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Update data in a Listview
 
Similar Threads
How to update rows in Table layout
How to get View from customised ListView?
Parse large String data
Query on enhanced FOR loop
HashMap remove multiple elements