Skip to content

Commit

Permalink
Android: make a distinction between success and cancel when adding an…
Browse files Browse the repository at this point in the history
… event
  • Loading branch information
EddyVerbruggen committed Nov 13, 2013
1 parent 6e6c402 commit ecb922f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/android/nl/xservices/plugins/Calendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo

public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RESULT_CODE_CREATE) {
if (resultCode == Activity.RESULT_OK || resultCode == Activity.RESULT_CANCELED) {
if (resultCode == Activity.RESULT_OK) {
callback.success();
} else if (resultCode == Activity.RESULT_CANCELED) {
callback.error("User cancelled");
} else {
callback.error("Unable to add event (" + resultCode + ").");
}
Expand Down

0 comments on commit ecb922f

Please sign in to comment.