I have a screen which asks user to enter PIN. I have 4 separate boxes & each box will have only one digit. So I want to keep the Numeric keypad open through out the life of an activity. I am able to force keypad open up on activity starts. But On presses back button it gets hidden.
Asked
Active
Viewed 591 times
1 Answers
1
Can you set this as part of your activity section on your manifest file :
android:windowSoftInputMode="stateAlwaysVisible"
you could try something like this :
public class EditView extends EditText {
public EditView (Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
return true;
}
}

lokoko
- 5,785
- 5
- 35
- 68
-
Could you try adjustResize – lokoko Feb 08 '13 at 07:54
-
`adjustResize` also hides the keypad on Back Button pressed – hemu Feb 08 '13 at 07:57
-
Do you have 4 activities for the 4 boxes ? – lokoko Feb 08 '13 at 07:58
-
Nope Only one activity.....And through out this activity I need the keypad open... – hemu Feb 08 '13 at 07:58
-
You could refer to this : http://stackoverflow.com/questions/1509719/android-how-to-make-the-keypad-always-visible – lokoko Feb 08 '13 at 08:03
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/24170/discussion-between-lokoko-and-hemu) – lokoko Feb 08 '13 at 08:06