public Button stb; static int cnt=0; public ArrayList Butgrp1 = new ArrayList(); Timer myt; TimerTask t; stb.setOnClickListene
You can pass the Activity as a parameter to the method that runs the timertask, and then you can use Activity.runOnUiThread to execute your tasks in UI Thread. There are lots of post in stackoverflow site regarding the usage of runOnUiThread usage.