Code example for ContentValues

Methods: insert

0
        ReceiveUriService.clearStarted(); 
        grantUriPermission(sub2Uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION, true);
        ReceiveUriService.waitForStart(); 
 
        // See if we now have access to the provider. 
        getContext().getContentResolver().insert(sub2Uri, new ContentValues());
 
        // And still to the previous URI. 
        getContext().getContentResolver().insert(subUri, new ContentValues());
 
        // But not reading. 
        assertReadingContentUriNotAllowed(sub2Uri, "shouldn't read from granted write");
 
        // And not to the base path. 
        assertWritingContentUriNotAllowed(uri, "shouldn't write non-granted base URI");
 
        // And not a sub-path. 
        assertWritingContentUriNotAllowed(sub2SubUri, "shouldn't write non-granted sub URI");
 
        if (false) { 
            synchronized (this) {