Skip to content

Instantly share code, notes, and snippets.

@granoeste
Created May 20, 2011 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save granoeste/982578 to your computer and use it in GitHub Desktop.
Save granoeste/982578 to your computer and use it in GitHub Desktop.
[Android]Handler
final private Handler mHandler = new Handler() {
@Override
public void handleMessage(final Message msg) {
switch (msg.what) {
case MESSAGE_ONE:
// TODO:
return;
case MESSAGE_TWO:
// TODO:
return;
case MESSAGE_TREE:
// TODO:
return;
}
}
};
private static final int MESSAGE_ONE = 1;
private static final int MESSAGE_TWO = 2;
private static final int MESSAGE_TREE = 3;
mHandler.sendMessage(mHandler.obtainMessage(MESSAGE_ONE, <Object>));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment