获取系统短信

    xiaoxiao2022-06-30  26

    public void onClick(View v) { Uri uri=Uri.parse("content://sms"); //查询 Cursor cursor = contentResolver.query(uri,new String[]{"date","type","body","address"},null,null,null); //遍历 while(cursor.moveToNext()){ long date=cursor.getLong(cursor.getColumnIndex("date")); int type=cursor.getInt(cursor.getColumnIndex("type")); String body=cursor.getString(cursor.getColumnIndex("body")); String address=cursor.getString(cursor.getColumnIndex("address")); Log.d(TAG,"address:"+address+"date:"+date+"type:"+type+"body:"+body); } }
    转载请注明原文地址: https://ju.6miu.com/read-1126022.html

    最新回复(0)