|
|
@@ -73,6 +73,8 @@ public class Contact extends Fragment {
|
|
|
|
|
|
Cursor cursor = getActivity().getApplicationContext().getContentResolver().query(uri, projection,
|
|
|
null, null, null);
|
|
|
+ if ( cursor == null )
|
|
|
+ return;
|
|
|
cursor.moveToFirst();
|
|
|
|
|
|
int numberColumnIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
|
|
|
@@ -81,6 +83,7 @@ public class Contact extends Fragment {
|
|
|
int nameColumnIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
|
|
|
name = cursor.getString(nameColumnIndex);
|
|
|
|
|
|
+ cursor.close();
|
|
|
EditText tvName = (EditText) thisView.findViewById(R.id.contactName);
|
|
|
EditText tvNumber = (EditText) thisView.findViewById(R.id.contactNumber);
|
|
|
|