Thanks for the update, however, I'm not using PhoneGap, so I'm afraid I don't have access to it's JS-native bridge API.

I've figured out the main issue I was having. It was very subtle indeed. The set up that I have is a separate panel, which is a child of a card layout component, with a text area field and form, so that a user can post a message. They have the opportunity to submit or cancel the message. It is most probable that the virtual keyboard will be open when the cancel or submit button is pressed. If either button is pressed the panel should disappear, the keyboard should be hidden, and they should be returned to the previous screen.

On closing the panel when tapping the back button (i.e setActiveItem), thinking of being a good memory management citizen, I tried to destroy the panel that I was leaving. However, if you do this straight away the OS gets a bit confused and inadvertently fails to close the open virtual keyboard. The solution is to destroy the panel via a setTimeout call, so that the native OS keyboard code gets a moment to run. I've included an outline of the code I used to solve the problem as I'm sure this has caught a few more developers out (and it certainly took me a long time to figure out what on earth was going on).

I've also included a work-around to the 'after' event on an animation being called twice.

Here is a snippet that I'm using. The callback and scope are optional and may be omitted. The code assumes that you are in a text field or a text area. Works for web app, so might work for native as well. Let me know if it's of any use.