I created an activity
which should have the keypad always popped up. So, I used requestFocus()
for the edittext. But I don't want only keypad disappear. Instead I want the whole activity to finish()
when back button is pressed even when keypad is present. I tried this answer, but it didn't work. I tried this too though it looked a bit extra work, but this isn't working with textwatcher. Below is the edittext. I kept it's dimension attributes to 0dp because to avoid showing user even the password field. Any help on achieving this is appreciated. Please let me know if any further information is needed.
<EditText
android:layout_width="0dp"
android:layout_height="0dp"
android:id="@+id/passwordet"
android:inputType="number"
/>
P.S: Overriding onBackPressed()
doesn't work because it doesn't get fired when keypad is present on Activity.