Skip to content

Instantly share code, notes, and snippets.

@jmahony
Created March 10, 2014 17:58
Show Gist options
  • Save jmahony/9470400 to your computer and use it in GitHub Desktop.
Save jmahony/9470400 to your computer and use it in GitHub Desktop.
class A extends Activity implement Observer {
onCreate() {
B b = new B(new Handler() {
handleMessage(Msg msg) {
// update model
}
});
new Thread(b).start();
}
}
class B implements Runnable {
Handler h;
public B (Handler h) {
this.h = h;
}
public run() {
// Do stuff
h.sendMessage(message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment