Solved

ListView refresh async

Posted on 2014-04-28
2
2,009 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

710 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