Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: which event fires when on screen keyboard appears?

Tags:

android

I'd like to hook to an event that fires when android's on screen keyboard appears. For example when user taps EditText to bring up the keyboard. Anyone know which event (or listener) to use?

Timo

like image 414
Pompair Avatar asked Nov 24 '10 16:11

Pompair


People also ask

How does Android handle keyboard events?

To handle an individual key press, implement onKeyDown() or onKeyUp() as appropriate. Usually, you should use onKeyUp() if you want to be sure that you receive only one event. If the user presses and holds the button, then onKeyDown() is called multiple times.

What is on screen keyboard on Android?

Instead of having physical keys, your device will show pictures of keys on the screen, which you can tap on. Different smartphones and tablets have slightly different keyboards, and your device will also show different keyboards for different functions.


1 Answers

According to following discussion thread in Android Developers Google Group the only way to solve this is to listen to size changed events of the main view. The thread is pretty old though. I wonder if any of the newer APIs have provided better way.

http://groups.google.com/group/android-developers/browse_thread/thread/9d1681a01f05e782

The last post explains a logic behind a working solution.

like image 83
Juhani Avatar answered Oct 04 '22 22:10

Juhani