Monday, 6 May 2013

Android: How to run Button on main Thread

In onCreate


informationButtonHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
// TODO Auto-generated method stub
Button b = (Button) msg.obj;
b.performClick();
super.handleMessage(msg);
}
};

at button functionality


Message m = new Message();
m.obj = informationTabButton;
informationButtonHandler.sendMessage(m);

No comments:

Post a Comment