Browse files

Fixed eclipse autoformatting, and made the plugin a tiny bit more mem…

…ory efficient
  • Loading branch information...
1 parent 7662e39 commit c08382c9a1b2cc22422936fd10efac7d4e48da5e @grandecomplex grandecomplex committed Jan 6, 2011
Showing with 8 additions and 13 deletions.
  1. +8 −13 Android/ContactView/ContactView.java
View
21 Android/ContactView/ContactView.java
@@ -12,8 +12,7 @@
public class ContactView extends Plugin {
private static final int PICK_CONTACT = 1;
- private String name = null;
- public String callback;
+ private String callback;
@Override
public PluginResult execute(String action, JSONArray args, String callbackId) {
@@ -30,24 +29,20 @@ public void startContactActivity() {
this.ctx.startActivityForResult((Plugin) this, intent, PICK_CONTACT);
}
- @Override
- public void onActivityResult(int reqCode, int resultCode, Intent data) {
- switch (reqCode) {
+@Override
+public void onActivityResult(int reqCode, int resultCode, Intent data) {
+ String name = null;
+ switch (reqCode) {
case (PICK_CONTACT):
if (resultCode == Activity.RESULT_OK) {
Uri contactData = data.getData();
- Cursor c = this.ctx.managedQuery(contactData, null, null, null,
- null);
+ Cursor c = this.ctx.managedQuery(contactData, null, null, null, null);
if (c.moveToFirst()) {
- name = c.getString(c
- .getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
- this.success(
- new PluginResult(PluginResult.Status.OK, name),
- this.callback);
+ name = c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
+ this.success(new PluginResult(PluginResult.Status.OK, name),this.callback);
}
}
break;
}
}
-
}

0 comments on commit c08382c

Please sign in to comment.