获取短信和通话记录

    Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI,
            null, null, null, CallLog.Calls.DEFAULT_SORT_ORDER);

    String strUriInbox = "content://sms/inbox"; 
    Uri uriSms = Uri.parse(strUriInbox); 
    Cursor c = context.getContentResolver().query( 
            uriSms, 
            new String[] { "_id", "thread_id", "address", 
                    "person", "date", "body" }, null, null, 
            null);

    据说是这样

你可能感兴趣的:(android,短信,联系人)