Skip to content

Instantly share code, notes, and snippets.

@greyson
Created June 20, 2011 06:43
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 greyson/1035217 to your computer and use it in GitHub Desktop.
Save greyson/1035217 to your computer and use it in GitHub Desktop.
What I really want.
private static abstract class MyClosure implements Runnable {
MyClosure( int x ) {
this.x = x;
}
int x;
}
/* later... somewhere in a method */
int x = 42;
handler.post( new MyClosure( x ) {
public void run() {
progress.setProgress( x );
}
}
/* I want this: */
int x = 42;
handler.post( lambda() {
progress.setProgress( x );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment