Reputation: 4417
I'm building an application of Html5
+ PhoneGap
for Android
.
I want that when a function call the Android keyboard be hidden.
I tried to do it in the following way:
function HideKeyboard() {
alert('HideKeyboard');
plugins.SoftKeyBoard.hide(function () {
alert('s');
}, function () {
alert('f');
});
}
It did not work! There is another way?
the alert 'HideKeyboard' appears, but other messages do not appear
Here my plugin:
<plugin name="SoftKeyBoard" value="com.phonegap.plugins.SoftKeyboard.SoftKeyBoard" />
Thank you ..
Upvotes: 1
Views: 847
Reputation: 45321
Did you:
/src/org/apache/cordova/plugins
with SoftKeyBoard.java
in itAdd the plugin definition to /res/xml/plugins.xml
:
<plugin name="SoftKeyBoard"
value="org.apache.cordova.plugins.SoftKeyBoard" />
Add softkeyboard.js
to /assets/www/js
Add to the head
in index.html
a reference to softkeyboard.js
:
<script type="text/javascript"
charset="utf-8"
src="js/softkeyboard.js"></script>
Finally call the following on the device:
window.cordova.plugins.SoftKeyBoard.hide(function () {
// WooHoo!
},function () {
// BooHoo!
});
So far I can only see that you've done step 2 & 5.
Updated it was a namespace issue it seems, and I've also updated to reflect that. Glad it worked.
Upvotes: 1