6

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.

GAMA
  • 5,958
  • 14
  • 79
  • 126
Sunil Dodiya
  • 2,605
  • 2
  • 18
  • 21

3 Answers3

2

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.

Community
  • 1
  • 1
Pedantic
  • 5,032
  • 2
  • 24
  • 37
1

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.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
ikeygeek
  • 11
  • 1
  • 1
    If you reference an extrenal link with the solution, please also add the solution in your answer. This way the solutions remains if the referenced website should go offline. The credit is still given to the original solution. Nothing is more frustrating than finding a dead link after reading "I found the perfect solution for your problem here: ". – flayn Aug 24 '12 at 10:45
  • the huge problem with this is that what's inside the bind function executes before the keyboard closes (at lest reproduceable on ios 7) – Andrei Cristian Prodan Jan 10 '14 at 13:51
-2

I use :

 inputElement.bind("closeKeyboard", function() {
             //do something
 });
agarcia
  • 87
  • 3