passText.setOnEditorActionListener( new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { // TODO Auto-generated method stub if ((actionId == EditorInfo.IME_ACTION_DONE) || (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) { // something To do. clearPage(); } return false; } });
안드로이드 프로그래밍 중에 soft keyboard에서 입력되는 완료(Done) 키(key)를 제어할 일이 있을 것이다.
public class InputPage extends Activity implements OnEditorActionListener
클래스 정의시 위와 같이 선언을 해주고 재정의를 통해서 수행해도 될 것이다.
passText.setOnEditorActionListener(this);위와 같이 변경해 준다면 이용 가능하겠지..
'MISCELLANEOUSNESS' 카테고리의 다른 글
내 eclipse 환경 설정에 필요한 주소들 (0) | 2011.01.28 |
---|---|
Android EditText 키보드 보이기. (0) | 2011.01.09 |
Android ImageView 여백에 투명효과 주기. (0) | 2011.01.09 |