Created
July 10, 2015 09:03
-
-
Save sys1yagi/91e3485cd19f942940f0 to your computer and use it in GitHub Desktop.
This file contains 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
//コールバック持つならこういう感じにすると | |
interface OnClickListener { | |
boolean onClick(View view); | |
class EmptyOnClickListener implements OnClickListener { | |
@Override | |
public boolean onClick(View view) { | |
return false; | |
} | |
public static EmptyOnClickListener get() { | |
return new EmptyOnClickListener(); | |
} | |
} | |
} |
This file contains 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
//nullチェックいらなくなって楽ちんだね | |
OnClickListener onClickListener = OnClickListener.EmptyOnClickListener.get(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment