Created
October 25, 2013 13:51
-
-
Save asuraphel/7155026 to your computer and use it in GitHub Desktop.
The semi-colon before the last one
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
addToDo.setOnKeyListener( new View.OnKeyListener() { | |
public boolean onKey(View V, int keyCode, KeyEvent event) { | |
if( event.getAction() == KeyEvent.ACTION_DOWN ) { | |
if( (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) || (keyCode == KeyEvent.KEYCODE_ENTER)) { | |
String newItem = addToDo.getText().toString(); | |
onNewItemAddedListener.onNewItemAdded(newItem); | |
addToDo.setText(""); | |
return true; | |
} | |
} | |
return false; | |
} | |
};); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment