Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8930299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:51:43+00:00 2026-06-15T08:51:43+00:00

I have an PhoneGap application, it’s working properly. The only thing bugging me is

  • 0

I have an PhoneGap application, it’s working properly. The only thing bugging me is the way PhoneGap handles the soft keyboard; it doesn’t hide when an input is blur’ed. It does do this in iOS, but it even stays when loading a new page in Android.

I had a look at this:
http://wiki.phonegap.com/w/page/27915465/How%20to%20show%20and%20hide%20soft%20keyboard%20in%20Android

and this:
https://github.com/phonegap/phonegap-plugins/tree/master/Android/SoftKeyboard

but they both did not work for me, any ideas?

Regards,
Erik

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:51:45+00:00Added an answer on June 15, 2026 at 8:51 am

    The plugin you linked to worked for me (had exactly the same issue):

    $("#eingabe").blur(); //for ios
    var softkeyboard = window.cordova.plugins.SoftKeyBoard;
    softkeyboard.hide();
    

    You probably used Cordova 2.0.0 (or greater) and didn’t modify the plugin files (which are written for Phonegap < 2.0).

    Here are the updated files (the ones I use):

    softkeyboard.js

    cordova.plugins = cordova.plugins || {};
    
    cordova.plugins.SoftKeyBoard = {
    show: function (win, fail) {
        return cordova.exec(
            function (args) { if (win !== undefined) { win(args); } },
            function (args) { if (fail !== undefined) { fail(args); } },
            'SoftKeyBoard', 'show', []
        );
    },
    
    hide: function (win, fail) {
        return cordova.exec(
            function (args) { if (win !== undefined) { win(args); } },
            function (args) { if (fail !== undefined) { fail(args); } },
            'SoftKeyBoard', 'hide', []
        );
    },
    
    isShowing: function (win, fail) {
        return cordova.exec(
            function (args) { if (win !== undefined) { win(args); } },
            function (args) { if (fail !== undefined) { fail(args); } },
            'SoftKeyBoard', 'isShowing', []
        );
    }
    };
    

    SoftKeyBoard.java

    package org.apache.cordova.plugins;
    
    import org.json.JSONArray;
    import android.content.Context;
    import android.view.inputmethod.InputMethodManager;
    import org.apache.cordova.api.Plugin;
    import org.apache.cordova.api.PluginResult;
    
    public class SoftKeyBoard extends Plugin {
    public SoftKeyBoard () { }
    
    public void showKeyBoard () {
        InputMethodManager mgr = (InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
        mgr.showSoftInput(webView, InputMethodManager.SHOW_IMPLICIT);
        ((InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(webView, 0);
    }
    
    public void hideKeyBoard() {
        InputMethodManager mgr = (InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
        mgr.hideSoftInputFromWindow(webView.getWindowToken(), 0);
    }
    
    public boolean isKeyBoardShowing() {
        // if more than 100 pixels, its probably a keyboard...
        int heightDiff = webView.getRootView().getHeight() - webView.getHeight();
        return (100 < heightDiff);
    }
    
    public PluginResult execute(String action, JSONArray args, String callbackId) {
        if (action.equals("show")) {
            this.showKeyBoard();
            return new PluginResult(PluginResult.Status.OK, "done");
        } else if (action.equals("hide")) {
            this.hideKeyBoard();
            return new PluginResult(PluginResult.Status.OK);
        } else if (action.equals("isShowing")) {
            return new PluginResult(PluginResult.Status.OK, this.isKeyBoardShowing());
        } else {
            return new PluginResult(PluginResult.Status.INVALID_ACTION);
        }
    }
    }
    

    Modify config.xml

    Also make sure that you add the following line in “res/xml/config.xml“:

    <plugin name="SoftKeyBoard" value="org.apache.cordova.plugins.SoftKeyBoard" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a Phonegap application.I have used header for every page. But when
I have developed android phonegap application using phonegap 1.9.0.Its was working fine in android
we have successfully created a decent phonegap application working on android and iphone. (using
I have a Phonegap/jQuery application which is working great, however in one area the
I have started to working with phoneGap application for android. I followed the steps
hi i have a fully working phonegap application with a number of files (both
I'm working on a phonegap application using cordova 1.9. I have a syntax error
I have a phonegap application targeting iPad that needs to embed a video on
I have a phonegap application which will need to take a zip archive of
I have developed the android phonegap application using html page and css. But My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.