Redmi Phones Not Asking SMS Permissions And Hence Not Reading Sms
Following is my code:
Solution 1:
After Long Time of trying, Got MI SMS permission(Through SMS Provider). Add this Method (content provider method) with your activity or fragment. you will able to get permission.
private void displaySmsLog() {
Uri allMessages = Uri.parse("content://sms/");
//Cursor cursor = managedQuery(allMessages, null, null, null, null); Both are same
Cursor cursor = this.getContentResolver().query(allMessages, null,
null, null, null);
while (cursor.moveToNext()) {
for (int i = 0; i < cursor.getColumnCount(); i++) {
Log.d(cursor.getColumnName(i) + "", cursor.getString(i) + "");
}
Log.d("One row finished",
"**************************************************");
}
}
Give it try , It worked for me.
Post a Comment for "Redmi Phones Not Asking SMS Permissions And Hence Not Reading Sms"