The following code worked fine two days ago, but suddenly - I did not do what happened - the code behaves abnormally, it gives the result as ID and RawId. For example:
Id =356
RawId = 356
I struggled to understand what was happening, unsuccessfully. Any ideas on how to fix this?
String projection[]=new String[]{ContactsContract.RawContacts._ID};
String where=ContactsContract.RawContacts.CONTACT_ID+"=?";
String selectionArgs[]=new String[]{String.valueOf(id)};
CursorLoader cLoader=new CursorLoader(this,ContactsContract.RawContacts.CONTENT_URI,projection,where,selectionArgs,null);
Cursor c=cLoader.loadInBackground();
c.moveToFirst();
rawContactID=c.getString(c.getColumnIndex(ContactsContract.RawContacts._ID));
Toast.makeText(getBaseContext(),"Id = "+id+" \nRaw id = "+rawContactID,Toast.LENGTH_SHORT).show();
source
share