分析github android 客户端 android:imeOptions="actionNext" //键盘显示下一步 android:inputType="textEmailAddress" android:nextFocusDown="@+id/et_password"//下一步所指向的位置 指定下一步键盘 所放位置 android:nextFocusDown
passwordText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (event != null && ACTION_DOWN == event.getAction() && keyCode == KEYCODE_ENTER) { //登陆 return true; } else return false; } }); passwordText.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == IME_ACTION_DONE ) { //登陆 return true; } return false; } });
//以上是控制键盘 登陆