5

I want to show the virtual keyboard with Prev, Next Buttons above the keyboard. When the user clicks prev button, cursor should move to the previous edittext input field and clicking on next button should go to the next edittext field in the view.

IF we open any page in android browser which asks input, we can see this kind of keyboard.

I need that to be implemented for the normal activity which I created. May I know how to do this ?

Thanks, Senthil.M

Senthil
  • 513
  • 2
  • 13
  • 24
  • If you want those buttons added on to the standard, built in keyboard for use in other apps, Pretty sure that can't be done. So. Do you want to use those buttons in your own activity, or are you making your own keyboard, or you want to modify the system keyboard for all EditText fields? – Reed Sep 05 '11 at 20:18
  • 1
    Thanks for the reply. I want to add the buttons with the built in keyboard if there is any possibility for that. If we see the android browser, we can see those buttons in the default keyboard itself. Or can we have two buttons in our own activity and when the keyboard is visible, is it possible to place those buttons above keyboard ? – Senthil Sep 06 '11 at 04:59

2 Answers2

3

For Next Button just add one line to your edit text field

   EditText et1 = (EditText)findViewById(R.id.editText1);
    et1.setImeOptions(EditorInfo.IME_ACTION_NEXT);
   EditText et2 = (EditText)findViewById(R.id.editText2);
    et2.setImeOptions(EditorInfo.IME_ACTION_NEXT);

and i m also search about previous Button Please check

Add Button to Android Soft Keyboard

Community
  • 1
  • 1
Jeetu
  • 686
  • 2
  • 10
  • 20
1

Simply set imeOptions to actionNext or actionPrev in EditText tag in xml like

<EditText
android:imeOptions="actionNext"
/>

And you can also set it programmatically like

yourEditText.setImeOptions(EditorInfo.IME_ACTION_NEXT);
Xar-e-ahmer Khan
  • 1,314
  • 15
  • 23