mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-11 00:00:05 +08:00
Change commands to plugins.
This commit is contained in:
@@ -3,8 +3,8 @@ package com.phonegap;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
import com.phonegap.api.Command;
|
||||
import com.phonegap.api.CommandResult;
|
||||
import com.phonegap.api.Plugin;
|
||||
import com.phonegap.api.PluginResult;
|
||||
|
||||
import android.provider.Contacts.ContactMethods;
|
||||
import android.provider.Contacts.People;
|
||||
@@ -16,7 +16,7 @@ import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteException;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ContactManager implements Command {
|
||||
public class ContactManager implements Plugin {
|
||||
|
||||
public class ContactTriplet
|
||||
{
|
||||
@@ -66,8 +66,8 @@ public class ContactManager implements Command {
|
||||
* @param args JSONArry of arguments for the command.
|
||||
* @return A CommandResult object with a status and message.
|
||||
*/
|
||||
public CommandResult execute(String action, JSONArray args) {
|
||||
CommandResult.Status status = CommandResult.Status.OK;
|
||||
public PluginResult execute(String action, JSONArray args) {
|
||||
PluginResult.Status status = PluginResult.Status.OK;
|
||||
String result = "";
|
||||
|
||||
try {
|
||||
@@ -77,9 +77,9 @@ public class ContactManager implements Command {
|
||||
else if (action.equals("search")) {
|
||||
this.search(args.getString(0), args.getString(1), args.getString(2));
|
||||
}
|
||||
return new CommandResult(status, result);
|
||||
return new PluginResult(status, result);
|
||||
} catch (JSONException e) {
|
||||
return new CommandResult(CommandResult.Status.JSON_EXCEPTION);
|
||||
return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user