how can I prevent the software keyboard to disappear until a specific EditText is choosen? I have several EditTexts in my Layout when it is opened the first is automatically sel
final InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
txt1.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if(!(hasFocus || txt2.hasFocus()))
{
mgr.hideSoftInputFromWindow(txt1.getWindowToken(), 0);
}
}
});
this code has good effect for focus handling and keyboard display...