@Test public void testDelete() throws Exception { final File file = new File(mContext.getFilesDir(), TEST_FILE); final Uri uri = stageFileAndGetUri(file, TEST_DATA); assertContentsEquals(TEST_DATA, uri); assertEquals(1, mResolver.delete(uri, null, null)); assertEquals(0, mResolver.delete(uri, null, null)); try { assertContentsEquals(new byte[0], uri); fail("Somehow read missing file?"); } catch(FileNotFoundException e) { } }
@Override public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) { final File file = mStrategy.getFileForUri(uri); return file.delete() ? 1 : 0; }
FileProvider extends ContentProvider { @Override public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) { final File file = mStrategy.getFileForUri(uri); return file.delete() ? 1 : 0; } }
FileProvider extends ContentProvider { @Override public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) { final File file = mStrategy.getFileForUri(uri); return file.delete() ? 1 : 0; }  }
FileProvider extends ContentProvider { @Override public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) { final File file = mStrategy.getFileForUri(uri); return file.delete() ? 1 : 0; }  @Override boolean onCreate(); @Override void attachInfo(@NonNull Context context, @NonNull ProviderInfo info); static Uri getUriForFile(@NonNull Context context, @NonNull String authority,
            @NonNull File file); @Override Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection,
            @Nullable String[] selectionArgs,
            @Nullable String sortOrder); @Override String getType(@NonNull Uri uri); @Override Uri insert(@NonNull Uri uri, ContentValues values); @Override int update(@NonNull Uri uri, ContentValues values, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override int delete(@NonNull Uri uri, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode); }
FileProvider extends ContentProvider { @Override public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) { final File file = mStrategy.getFileForUri(uri); return file.delete() ? 1 : 0; }  @Override boolean onCreate(); @Override void attachInfo(@NonNull Context context, @NonNull ProviderInfo info); static Uri getUriForFile(@NonNull Context context, @NonNull String authority,
            @NonNull File file); @Override Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection,
            @Nullable String[] selectionArgs,
            @Nullable String sortOrder); @Override String getType(@NonNull Uri uri); @Override Uri insert(@NonNull Uri uri, ContentValues values); @Override int update(@NonNull Uri uri, ContentValues values, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override int delete(@NonNull Uri uri, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode);  }