Skip to content

Commit

Permalink
changed getActivity to getThreadPool for correct Thread usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Brunkhorst committed Oct 15, 2013
1 parent 68621e8 commit eca3155
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/android/de/phonostar/SoftKeyboard.java
Expand Up @@ -32,28 +32,29 @@ public boolean isKeyBoardShowing() {

@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
SoftKeyboard _this = this
if (action.equals("show")) {
cordova.getActivity().runOnUiThread(new Runnable() {
cordova.getThreadPool().execute(new Runnable() {
public void run() {
this.showKeyBoard();
_this.showKeyBoard();
callbackContext.success("done");
}
});
return true;
}
else if (action.equals("hide")) {
cordova.getActivity().runOnUiThread(new Runnable() {
cordova.getThreadPool().execute(new Runnable() {
public void run() {
this.hideKeyBoard();
_this.hideKeyBoard();
callbackContext.success();
}
});
return true;
}
else if (action.equals("isShowing")) {
cordova.getActivity().runOnUiThread(new Runnable() {
cordova.getThreadPool().execute(new Runnable() {
public void run() {
callbackContext.success(Boolean.toString(this.isKeyBoardShowing()));
callbackContext.success(Boolean.toString(_this.isKeyBoardShowing()));
}
});
return true;
Expand Down

0 comments on commit eca3155

Please sign in to comment.