[Solved] automatically sms read not working in android

For Xiaomi Permission Dialog Use this Read all SMS private void displaySmsLog() { Uri allMessages = Uri.parse(“content://sms/”); //Cursor cursor = managedQuery(allMessages, null, null, null, null); Both are same Cursor cursor = getActivity().getContentResolver().query(allMessages, null, null, null, null); if (cursor!=null) { while (cursor.moveToNext()) { for (int i = 0; i < cursor.getColumnCount(); i++) { Log.d(cursor.getColumnName(i) + “”, … Read more

[Solved] passing data from service to fragment giving null point

Instead of passing data indirectly i used the direct way and i set like this in service Intent intent = new Intent(); intent.setAction(MY_ACTION); intent.putExtra(“DATAPASSED”, activeAudio.getTitle()); intent.putExtra(“ALBUM_DATA”,activeAudio.getAlbum()); sendBroadcast(intent); in my fragment @Override public void onStart() { super.onStart(); myReceiver = new MyReceiver(); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(MediaService.MY_ACTION); getActivity().registerReceiver(myReceiver, intentFilter); } private class MyReceiver extends BroadcastReceiver { … Read more