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

Apps setVisibility crashes with timer

I'm trying to write an app that has a button that appears and disappears after some time (similar to the maps' zoom in/out buttons).
My code is as follows:

..
t = new Timer(false);
t.schedule(new TimerTask() {public void run()
{
Log.d("starting disabling buttons", "== here ==");
for (Button b : buttons){
b.setVisibility(View.INVISIBLE);
Log.d("after visibility", "== done ==");
}
}}, 3000);
..

I get the first debug message but not the second. Ideas?

thanks
Guy
 

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