1

Is there a way to have a GridLayout with some pictures in KeyboardView in Android? I have tried to write it in xml but it gives me error that I cant have that element in KeyboardView.

jelic98
  • 723
  • 1
  • 12
  • 28

1 Answers1

2

Why are you using KeyboardView then?

Create an InputMethodService and in onCreateInputView(), return whatever layout you want to display.

@Override
public View onCreateInputView() {
        final View root = getLayoutInflater().inflate(R.layout.keyboard_layout, null);         

         //set all the click listeners for your views

        return root;
}
Prasad Pawar
  • 1,606
  • 1
  • 15
  • 30
  • I was trying to put emojis in gridview, but then I added those in keyboardview. Now there are emoji keys but I have to fix encoding errors because when user clicks on emoji key it prints some chinese letter. Do you know what should I do to fix this? – jelic98 Dec 12 '15 at 11:00