Unable to update TextView on a scheduled-basis

by Chris » Wed, 11 Nov 2009 23:37:33 GMT


Sponsored Links
 Hello everyone, I'm new to Android (but not Java), so bear with me.


I'm trying to create a stopwatch-type UI, where a digital timer is
displayed and incrementing every second.  I started off creating a
textview and attempted to update this textview (TextView.setText())
using either the TimerTask class to update the view in a timer as well
as updating the view in the same thread, using a Thread.sleep(1000).

In either case, the view does not get updated. Obviously this doesn't
seem to be the proper way to go about updating a text view.  Any
suggestions on the proper way to notify the textview?

Thanks
Chris

--



Other Threads

1. Problem with spinner in a list view

Hi,
  I am using a custom list adapter with a spinner in each item.
There is a strange problem with the value the spinner shows.
For some of the items the spinner always shows the first value in the
adapter set to the spinner but when I touch on spinner, on the pop up
selection list it shows the actual value which I have set before. I mean the
value shown in the spinner and the selected item that is shown in pop list
of the spinner are some times different.

Please help me and tell me why this happens.

-- 

2. How do I create a background loop method



It's the only solution to your problem, given your wake-the-phone-up
requirement. Your only alternatives would be to keep the phone on 100%
of the time, which will be bad.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

-- 

3. How to clear static variable values when will i close my application in android

4. Android Window policy

5. how can i store a view in a .png file in emulator sdcard

6. Not detecting soft keyboard keypresses

7. Enabling wifi tethering mode