tags:

views:

37

answers:

2

Is there a way to be notified when the keyboard is about to show, or has shown? The following events would be great:

keyboardWillShow keyboardDidShow keyboardWillHide keyboardDidHide

A: 

As MatrixFrog mentioned you can use the Activity's onCofigurationChanged method. With that you have keyboardWillShow and keyboardWillHide.

To get the other two you can try using one of the InputMethodManager's methods but I don't think a callback like that exists.

Macarse
Won't the first only work for physical keyboard?
Tseng
+1  A: 

The only way is to override the View's onSizeChanged() method. See this thread on the Android Developers group:

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

James