How to detect keyboard close event in android device with javascript

11,537

Solution 1

I don't use Phonegap, but I did some rudimentary Google searches like 'phonegap android hide keyboard event' and came across these two relevant posts from a few months ago.

First one is right here on SO: Android SoftKeyboardDetect: Ignore this event what does it mean?. It looks like if you drop down to "native" Java(...) Android tries to make this available.

This other one, Re: [PhoneGap] Re: SoftKeyboardDetect(328): Ignore on a phonegap-oriented website seems to suggest that the phonegap implementation or the SoftKeyboardDetect code is to blame.

I have Android code written in Java where it works just fine.

Solution 2

I have faced similar problem for iPhone app development with phonegap. I have fixed the problem with the following way.

$("input[type=text], textarea").
bind("blur", function(e) {
 window.scrollTo(0.0);
 loaded();
});

You can detect the close event with 'blur' action.

Share:
11,537
Sunil Dodiya
Author by

Sunil Dodiya

Relax, its only ONES and ZEROS !

Updated on June 24, 2022

Comments

  • Sunil Dodiya
    Sunil Dodiya almost 2 years

    I'm developing android application with phonegap. Currently I'm facing one problem with inputbox problem with specific HTC Android device and I have a solution for that. But I need to know when keyboard close event occurred.

    so my question is how to detect keyboard close event with phonegap or any plugins available to detect keyboard event for android device.?

    Please help. Thanks in advance.