Is there any intent/event that i can listen to when user slide out the keyboard on a phone with keyboard?
Thank you.
in your Manifest file, add this to your activity definition:
android:configChanges="keyboard|keyboardHidden"
and in your Activity java file, override the method onConfigurationChanged:
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if(newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) {
//handle keyboard slide out event
}
else if(newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES)
//handle keyboard slide in event
}
}
when a keyboard event fires off in this activity, this method will be called and you can do whatever you want.