on "pageshow" softkeyboard not showing up the first time with Cordova

on "pageshow" softkeyboard not showing up the first time with Cordova

      Hi,

I'm trying to get the keyboard to show up on Android inside the "pageshow" function using cordova.

It is suppose to focus into a input field (text) and the keyboard is suppose to show up.

It only focus into the input field but the keyboard didn't show up.

When I go back and then go into the same page again,  The keyboard shows up.

Does anyone have any idea as to why it doesn't show up the first time, or know any work around to it?

Here is my code:

  1.             var foundInput = null;
  2.             var allInput = document.getElementsByTagName("input");
  3.             for (var i = 0; i < allInput.length; ++i) {
  4.                 if (allInput[i].placeholder == "Search medication...") {
  5.                     foundInput = allInput[i];
  6.                 }
  7.             }
  8.             $(foundInput).focus();
  9.             $(foundInput).trigger('click');

Thank you