I have two EditText txtPassword,txtEmail based on radiobutton change event I just hide and show txtPassword field
I just want to change ImeOptions with porgrammatic for that I wrote following code
but this is not working. When I observe soft-keyboard this shows me done action in txtEmail (just because before radio changed only txtEmail is visible so automatic done appear)
but after manually focous in password field and than after if I observe soft-keyboard with email field it automatic changed it with next imeOptions. I just want if One txtEmail is visible than it have done imeOptions and if txtPassword,txtEmail both are visible than txtEmail have ImeOptions next and in txtPassword it have display done imeOptions. Thanks in advance.txtPassword.setImeOptions(EditorInfo.IME_ACTION_DONE);
txtEmail.setImeOptions(EditorInfo.IME_ACTION_NEXT);
Edit:
radiologin.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(RadioGroup group,int checkedId) {
// checkedId is the RadioButton selected
if (checkedId == R.id.radioWithoutPassword) {
txtPassword.setVisibility(View.GONE);
txtEmail.setBackgroundDrawable(getResources().getDrawable(R.drawable.both_corner));
txtEmail.setImeOptions(EditorInfo.IME_ACTION_DONE);
}
else
{
txtEmail.setImeOptions(EditorInfo.IME_ACTION_NEXT);
txtPassword.setImeOptions(EditorInfo.IME_ACTION_DONE);
txtPassword.setVisibility(View.VISIBLE);
txtEmail.setBackgroundDrawable(getResources().getDrawable(R.drawable.top_corner));
}
}
});