gigs gigs - 11 months ago 118
Android Question

Android - update custom listview every minute in real time

I know that in order to update Listview I have to use

. But, how can I update custom Listview every minute in real time?

For example, my app has created Listview at 05h:10m:20s and after 40 seconds it should updates Listview every one minute. In other words it should determines if current time have changed by one minute and than update Listview. How can I achieve that?


I suppose you want to update your ListView every minute at second 0. If not, you should use other answers.

If so, you can try register broadcast receiver for ACTION_TIME_TICK.

IntentFilter intentFilter = new IntentFilter();

Context.registerReceiver(new BroadcastReceiver() {
    public void onReceive(Context context, Intent intent) {
}, intentFilter);

Do not forget to call Context.unregisterReceiver() at onStop() of your Activity