首页 > 解决方案 > 如何使用查询在 android 中获取被阻止的 SMS 或 MMS?

问题描述

我想在 android(galaxy S8+) 中获取被阻止的 SMS 列表。我试过这个

Uri uri = Uri.parse("content://sms?simple=true");
                //Log.d("TAG","reached");
                ContentResolver con=getContentResolver();
                if(con==null){
                    Log.d("TAG","contentResolver not exist");
                    return;
                }
                Cursor cursor = con.query(uri, null, "spam_report=?", new String[]{"1"},"date_sent DESC");

和这个

Uri uri = Uri.parse("content://sms?simple=true");
                //Log.d("TAG","reached");
                ContentResolver con=getContentResolver();
                if(con==null){
                    Log.d("TAG","contentResolver not exist");
                    return;
                }
                Cursor cursor = con.query(uri, null, "locked=?", new String[]{"1"},"date_sent DESC");

这段代码的结果并没有给我想要的结果。如何获取被阻止的消息(彩信或短信)!!

标签: javaandroidandroid-studio

解决方案


推荐阅读