Solved

ListView refresh async

Posted on 2014-04-28
2
1,912 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

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Once again I push the limits of my phone.  An introduction to the Android Google Now Launcher.
A brand new malware strain was recently discovered by security researchers at Palo Alto Networks dubbed “AceDeceiver.” This new strain of iOS malware can successfully infect non-jailbroken devices and jailbroken devices alike.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.

863 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

19 Experts available now in Live!

Get 1:1 Help Now