Skip to content

Commit c08382c

Browse files
committed
Fixed eclipse autoformatting, and made the plugin a tiny bit more memory efficient
1 parent 7662e39 commit c08382c

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

Android/ContactView/ContactView.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
public class ContactView extends Plugin {
1414
private static final int PICK_CONTACT = 1;
15-
private String name = null;
16-
public String callback;
15+
private String callback;
1716

1817
@Override
1918
public PluginResult execute(String action, JSONArray args, String callbackId) {
@@ -30,24 +29,20 @@ public void startContactActivity() {
3029
this.ctx.startActivityForResult((Plugin) this, intent, PICK_CONTACT);
3130
}
3231

33-
@Override
34-
public void onActivityResult(int reqCode, int resultCode, Intent data) {
35-
switch (reqCode) {
32+
@Override
33+
public void onActivityResult(int reqCode, int resultCode, Intent data) {
34+
String name = null;
35+
switch (reqCode) {
3636
case (PICK_CONTACT):
3737
if (resultCode == Activity.RESULT_OK) {
3838
Uri contactData = data.getData();
39-
Cursor c = this.ctx.managedQuery(contactData, null, null, null,
40-
null);
39+
Cursor c = this.ctx.managedQuery(contactData, null, null, null, null);
4140
if (c.moveToFirst()) {
42-
name = c.getString(c
43-
.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
44-
this.success(
45-
new PluginResult(PluginResult.Status.OK, name),
46-
this.callback);
41+
name = c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
42+
this.success(new PluginResult(PluginResult.Status.OK, name),this.callback);
4743
}
4844
}
4945
break;
5046
}
5147
}
52-
5348
}

0 commit comments

Comments
 (0)