I'm trying to create my own virtual keyboard since no default keyboard fits my needs.
I have created the layout (keyboard.xml), and I'd like to make my keyboard to appear in the bottom of the screen, as other keyboards do. I thought of using popupWindow.
I tried pw.showAtLocation(this.findViewById(R.id.mainLinearLayout), Gravity.BOTTOM, 0, 0)
, where mainLinearLayout is the id of the (root xml element) linearLayout of the currentActivity, but I get a "android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?".
Any idea how to solve that ?
Thanks.