mirror of
https://github.com/apache/cordova-android.git
synced 2025-04-24 18:30:12 +08:00
Issue 72: Contact.Save: onSuccess callback is called when contact is not saved.
This commit is contained in:
parent
0aacfbdd50
commit
fd8bb2f671
@ -46,7 +46,14 @@ public class ContactManager extends Plugin {
|
|||||||
return new PluginResult(status, res, "navigator.service.contacts.cast");
|
return new PluginResult(status, res, "navigator.service.contacts.cast");
|
||||||
}
|
}
|
||||||
else if (action.equals("save")) {
|
else if (action.equals("save")) {
|
||||||
return new PluginResult(status, contactAccessor.save(args.getJSONObject(0)));
|
if (contactAccessor.save(args.getJSONObject(0))) {
|
||||||
|
return new PluginResult(status, result);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
JSONObject r = new JSONObject();
|
||||||
|
r.put("code", 0);
|
||||||
|
return new PluginResult(PluginResult.Status.ERROR, r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (action.equals("remove")) {
|
else if (action.equals("remove")) {
|
||||||
if (contactAccessor.remove(args.getString(0))) {
|
if (contactAccessor.remove(args.getString(0))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user