Android:如何在后退按钮上隐藏软键盘和栏。我正在使用以下代码,但它首先隐藏键盘,然后再次点击后退按钮,它隐藏了栏。:
epwd.setOnKeyListener(new OnKeyListener()
{
@Override
public boolean onKey(View v, int keyCode, KeyEvent event)
{
// TODO Auto-generated method stub
if (keyCode == KeyEvent.KEYCODE_BACK)
{
hiding();
return true;
}
}
});
public void hiding(){
bottompanel.setVisibility(View.GONE);
InputMethodManager imm =(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(elogin.getWindowToken(), 0);
bottompanel.setVisibility(View.INVISIBLE);
}
由于