• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Running Counter in Listitem without requery?

touchit

Lurker
Mar 1, 2012
4
0
Hello,
I would like to have a running counter (e.g. from 10 Minutes down to 0) in an List item. I have a cursor adapter and in a spezific field the time How long the counter should run.

I tried it with a background service which calls every minute a requery to the cursor to refresh the counter in the list item.
But now I have a conflict with other parts in the list which are also depends on cursor requeries.

Maybe somebody have a best practice for a running counter in an cursor adapter without calling requery?
 
thats correct, i am sure timer with a timertask is a good part to implement a timer.

But the actual problem is not to implement the Timer, my background service do this (maybe not in a good) but in a accurate way, the problem is to update the TextView in the List Item without a requery.

So somebody with an idea to update a TextView in an List item in an Cursor Adapter?

I tried to call the setText in the Textview object in my timer service, but get an error that I couldnt call a view element from another thread.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones