How does the content observer work on deleted files?

I am new to Android development, I am having trouble tracking deleted files such as audio, video, images, etc. I want to get all the information about a deleted file, and then I want to move the deleted files to a separate folder.

+4
source share
2 answers

In android, files are managed through content providers. For each file there is an index in the content provider, and we access them with the cursor. you can track the index from the content provider using the cursor and move it to another location and update the content provider

+1
source
// Defines selection criteria for the rows you want to delete String mSelectionClause = UserDictionary.Words.APP_ID + " LIKE ?"; String[] mSelectionArgs = {"user"}; // Defines a variable to contain the number of rows deleted int mRowsDeleted = 0; ... // Deletes the words that match the selection criteria mRowsDeleted = getContentResolver().delete( UserDictionary.Words.CONTENT_URI, // the user dictionary content URI mSelectionClause // the column to select on mSelectionArgs // the value to compare to ); 

For more information, visit the link to understand content providers:

http://developer.android.com/guide/topics/providers/content-provider-basics.html

0
source

Source: https://habr.com/ru/post/1495872/


All Articles