in my android application i\'m using Timer schedule.but getting Timer-0 fatal exception as below.how can i remove it.i have also mentioned code below -
01-28 13:
It is very simple, you are scheduling the Timer but not cancelling it never. So Task scheduled will be in the queue and wait for its turn. By that time it should get executed your Activity might not be in the foreground and it is unable to find the views. So it is throwing the Fatal Exception. Inorder, to get rid of the above issue, you need to cancel the tasks whenever you are going from that particular activity by calling myTimer.cancel()
.
Or else
Use the Handler class.