Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save martinomburajr/f6bda2970d03d37c57ecd3619d660f12 to your computer and use it in GitHub Desktop.

Select an option

Save martinomburajr/f6bda2970d03d37c57ecd3619d660f12 to your computer and use it in GitHub Desktop.
The Android Looper Thread
/**
* Retrieved from https://developer.android.com/reference/android/os/Looper.html
*/
class LooperThread extends Thread {
public Handler mHandler;
public void run() {
Looper.prepare();
mHandler = new Handler() {
public void handleMessage(Message msg) {
// process incoming messages here
}
};
Looper.loop();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment