I am trying to read sms in android. In my manifest file, I have:
<uses-permission android:name="android.permission.READ_SMS" />
My Code:
Cursor cursor = getContentResolver().query(Uri.parse("content://mms-sms/inbox"), null, null, null,null);
((TextView) findViewById(R.id.info1)).setText("Number of messages: " + cursor.getColumnCount());
The problem is that I have more than 17 smses in my inbox but the output it gives is
Number of messages: 17
I have looked at this, this, this and this. Can someone please tell what the problem is?