I am trying to read sms from content provider. I had following code
Uri uri = Uri.parse(SMS_URI_INBOX);
String whereClause = \"address=?\";
String[] wher
Appending to @MikeM. comment, below piece of code helped me to get threadId using which I am making query in SMS Content Provider
//Getting thread Id
ContentResolver mContentResolver = context.getContentResolver();
Uri uriSmsURI1 = Uri.withAppendedPath(Telephony.MmsSms.CONTENT_FILTER_BYPHONE_URI, address);
String[] projection1 = {this.threadId};
Cursor c1 = dbService.query(mContentResolver, uriSmsURI1, projection1, null, null, null);
if(c1.getCount()==0) {
log.error(methodName, "Got count: "+c1.getCount()+" While looking for ThreadID");
return null;
}
String threadId = null;
while(c1.moveToNext()){
threadId = c1.getString(c1.getColumnIndexOrThrow(this.threadId));
}
c1.close();