1
我調整了我的首頁的整個佈局由250時,在兩個的EditText字段的用戶輸入,我需要拉屎回來當鍵盤被駁回,我用禁用後退按鈕時,軟鍵盤彈出,Android的
公共類DoneOnEditorActionListener實現OnEditorActionListener {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
// TODO Auto-generated method stub
try{
if (actionId == EditorInfo.IME_ACTION_DONE
|| actionId == EditorInfo.IME_NULL
|| event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
InputMethodManager imm = (InputMethodManager)v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
LoginActivity.rootView.setY(0);
return true;
}
}catch (Exception e){
}
return false;
}
} ,它工作正常,但是當我點擊後退按鈕,鍵盤也被駁回,佈局沒有移回。有沒有辦法只在軟鍵盤啓動時禁用後退按鈕?