ContentResolver cr = getContentResolver();
Cursor cur = cr.query(Uri.parse(\"content://sms/conversations/\"), null,null,null, null);
is not wo
This function is for fetching conversations
private void getSMSCOnversationlist() {
Uri SMS_INBOX = Uri.parse("content://sms/conversations/");
Cursor c = getActivity().getContentResolver().query(SMS_INBOX, null,null, null, "date desc");
String[] count = new String[c.getCount()];
String[] snippet = new String[c.getCount()];
String[] thread_id = new String[c.getCount()];
c.moveToFirst();
for (int i = 0; i < c.getCount(); i++) {
count[i] = c.getString(c.getColumnIndexOrThrow("msg_count")).toString();
thread_id[i] = c.getString(c.getColumnIndexOrThrow("thread_id")).toString();
snippet[i] = c.getString(c.getColumnIndexOrThrow("snippet")).toString();
Toast.makeText(getActivity(), count[i] + " - " + thread_id[i] + " - " + snippet[i]+ " - " , Toast.LENGTH_LONG).show();
c.moveToNext();
}
c.close();
}