Solved

ListView refresh async

Posted on 2014-04-28
2
1,877 Views
Last Modified: 2014-05-31
Hi, i would like to know whats the cleanest and better way to implement autorefresh (async) on a ListView in android.

Sometimes users are checking the info in the listview and in the meantime they get an update via service.

How to display to the current ListView?
Does this envolve a service requesting the update every time?

Any clean aproach would be great to receive.
0
Comment
Question by:JavierVera
2 Comments
 
LVL 12

Accepted Solution

by:
KRUNAL TAILOR earned 500 total points
ID: 40028800
Hi JavierVera,

Are you talking about the similar to facebook feed? (This is for Manual Refresh)
If Yes, in that case you have to use  pulltorefresh and ScrollListener concepts in the app. There are many Pull to refresh library available for android.

Or

Are you talking about the "Auto refresh"? (This is for Auto Refresh)
Then, You need to add iteminfo from ArrayList from Adapter and call notifyDatasetChanged() , When you call notifyDatasetChanged() method it will refresh your listview with ArrayList with updated data.

Also see some ref stuff over here below.

Ref:
1) http://stackoverflow.com/questions/23124414/android-auto-refresh-when-new-data-inserted-into-listview
2) http://androidadapternotifiydatasetchanged.blogspot.in/

Hope this will help you.

Thanks & Regards,
Krunal T. Tailor
0
 
LVL 1

Author Closing Comment

by:JavierVera
ID: 40102995
Hi there, thank you for guiding me on the correct path and options!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
For Sennheiser, comfort, quality and security are high priority areas. This paper addresses the security of Bluetooth technology and the supplementary security that Sennheiser’s Contact Center and Office (CC&O) headsets provide.  
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now