Re: [android-developers] Re: update TextView inside a TimerTask

2012-03-14 Thread surya phani
thanks for ur code On Tue, Mar 13, 2012 at 7:29 PM, harsh chandel wrote: > you can use this timer given in devloper guide > > new CountDownTimer(3, 1000) { > >public void onTick(long millisUntilFinished) { > >TextView txttimer=(TextView

[android-developers] Re: update TextView inside a TimerTask

2012-03-13 Thread harsh chandel
you can use this timer given in devloper guide new CountDownTimer(3, 1000) { public void onTick(long millisUntilFinished) { TextView txttimer=(TextView) findViewById(R.id.timeremaining); txttimer.setTex

Re: [android-developers] Re: update TextView inside a TimerTask

2012-03-13 Thread Alimooghashang
thank you very much now my application works well On Tue, Mar 13, 2012 at 11:21 AM, tsukishiro yamazaki < tsukishir...@gmail.com> wrote: > You can take the sample here > http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog > for your reference. > Check the sample code marked

[android-developers] Re: update TextView inside a TimerTask

2012-03-13 Thread tsukishiro yamazaki
You can take the sample here http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog for your reference. Check the sample code marked by the section " *Example ProgressDialog with a second thread* " Thanks and bes

Re: [android-developers] Re: update TextView inside a TimerTask

2012-03-13 Thread Alimooghashang
Hi thanks i wonder if you help me with an example! i implemented timer like this: Timer t = new Timer(); > > TimerTask tt = new TimerTask() { > @Override > public void run() { > } > }; > t.scheduleAtFixedRate(tt, 100, 1000); my texview is this: > TextView tv = (TextView)findView

[android-developers] Re: update TextView inside a TimerTask

2012-03-12 Thread tsukishiro yamazaki
If I'm not mistaken, any code inside a TimerTask is running on a different thread. This means that it won't have access to the main UI thread. So if you put some code in there to update your Textview, you will probably end up with an exception or error saying that it cannot access the main ui t