Solved

ListView refresh async

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 113
login form jsp example 2 37
Problem to App source 6 73
SequenceInputStream example 3 19
A short article about a problem I had getting the GPS LocationListener working.
With mobile becoming increasingly important to the business world, it is in your best interest to make sure that your email signature looks great across all types of devices. Find out how to create a mobile email signature with this guide.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

827 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