0

I'm a new Android dev and I'm currently developing an app which is to display ListView data from web database.

But what I want is to update the data based on system time.

Let's say right now displaying data from database:

  1. lalala
  2. lololo
  3. wewewe

and I need to update these data automatically FROM the database every 24 hours so that the outcome will be:

  1. lilili
  2. wowowo
  3. popopo

I've tried System.currentTimeMillis(), it does not return any values.

Any professional out there could help me out ?

Thanks in advance.

1 Answers1

-1

this.runOnUiThread(); of Your Activity can help you in this. This method updates itself after every second. What you should have to do is to pass a runnable as a parameter. Now in this runnable you can update your data. You can have a check in this runnable for 24 hours.

Regards

wojciii
  • 4,253
  • 1
  • 30
  • 39
user1286085
  • 11
  • 1
  • 4
  • He should probably use the alarm manager instead of a runnable - depending on his needs. Please see http://stackoverflow.com/questions/1082437/android-alarmmanager. – wojciii Aug 01 '12 at 10:32