From 7f9ce69a4caa94db7c81607a8729e148de90e2f9 Mon Sep 17 00:00:00 2001 From: Alessandro Ferro <49845537+xfarrow@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:23:58 +0200 Subject: [PATCH] Update WhitelistContactsActivity.java --- .../xfarrow/locatemydevice/WhitelistContactsActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/src/main/java/com/xfarrow/locatemydevice/WhitelistContactsActivity.java b/src/app/src/main/java/com/xfarrow/locatemydevice/WhitelistContactsActivity.java index 86b775f..bf5221b 100644 --- a/src/app/src/main/java/com/xfarrow/locatemydevice/WhitelistContactsActivity.java +++ b/src/app/src/main/java/com/xfarrow/locatemydevice/WhitelistContactsActivity.java @@ -23,7 +23,7 @@ public class WhitelistContactsActivity extends AppCompatActivity { private ListView contactsListView; private ArrayList contacts; private ArrayAdapter listviewAdapter; - private WhitelistDbHandler whitelistDbHandler = new WhitelistDbHandler(this); + private final WhitelistDbHandler whitelistDbHandler = new WhitelistDbHandler(this); private static final int CONTACT_PICK_CODE = 123; @@ -67,7 +67,7 @@ public class WhitelistContactsActivity extends AppCompatActivity { } - // Add "add" button on the top + // Add "add contact" button on the top @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_add, menu); @@ -91,7 +91,7 @@ public class WhitelistContactsActivity extends AppCompatActivity { @Override protected void onActivityResult (int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); - if (resultCode == Activity.RESULT_OK && requestCode == 123) { + if (resultCode == Activity.RESULT_OK && requestCode == CONTACT_PICK_CODE) { Uri contactData = data.getData(); Cursor c = getContentResolver().query(contactData, null, null, null, null); if (c.moveToFirst()) {