Created
March 10, 2014 17:58
-
-
Save jmahony/9470400 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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