How to know if keyboard (dis)appears in Android? -
i have edittext , want give more lines when keyboard appears. looking "onkeyboardappearslistener" can't find it. think must exist, perhaps in different way...
you have @override onconfigurationchanged
able handle runtime changes:
@override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); // checks whether hardware or on-screen keyboard available if (newconfig.keyboardhidden == configuration.keyboardhidden_no) { toast.maketext(this, "keyboard visible", toast.length_short).show(); } else if (newconfig.keyboardhidden == configuration.keyboardhidden_yes) { toast.maketext(this, "keyboard hidden", toast.length_short).show(); } }
example taken here. take here keyboard related (among others) fields might want use.
edit (rivierakid): changed take account of hard or on-screen keyboard.
Comments
Post a Comment