diff --git a/src/android/PinDialog.java b/src/android/PinDialog.java index 6be1d6e..cbd27a7 100644 --- a/src/android/PinDialog.java +++ b/src/android/PinDialog.java @@ -9,17 +9,15 @@ import org.json.JSONObject; import android.app.AlertDialog; -import android.app.ProgressDialog; import android.content.DialogInterface; import android.text.InputType; import android.text.method.PasswordTransformationMethod; +import android.view.WindowManager; import android.widget.EditText; public class PinDialog extends CordovaPlugin { - public ProgressDialog spinnerDialog = null; - public PinDialog() { } @@ -108,9 +106,11 @@ public void onCancel(DialogInterface dialog){ } }); - dlg.create(); - dlg.show(); - + AlertDialog instance = dlg.create(); + instance.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); + instance.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); + instance.show(); + promptInput.requestFocus(); }; }; this.cordova.getActivity().runOnUiThread(runnable); diff --git a/src/ios/CDVPinDialog.m b/src/ios/CDVPinDialog.m index bd33a20..73c0ce5 100644 --- a/src/ios/CDVPinDialog.m +++ b/src/ios/CDVPinDialog.m @@ -43,7 +43,7 @@ - (void)prompt:(CDVInvokedUrlCommand*)command } -- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +- (void)alertView:(UIAlertView*)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { CDVPluginResult* result;