Is there anyway I can run this simple operation in another thread or enable the other buttons?
Yes, don't call Thread.sleep()
on the UI Thread
or the UI Thread
will sleep and you won't be able to do any UI
stuff the entire time. Something like
new Thread(new Runnable() {
public void run() {
// do stuff that doesn't touch the UI here
}
}).start();
code borrowed from Mr. Murphy here
You also might want to read the docs here