4

I am new to Android development , I am having trouble in tracking the deleted files like audio, video, images etc. I want to get all details of a deleted file and later I want to move deleted files in a separate folder.

2 Answers2

1

In android, files are managed through content providers. For each file there is an index in content provider and that we access them using cursor. you can keep track of index from content provider using cursor and move it to other place and update content provider

Sushil
  • 8,250
  • 3
  • 39
  • 71
0
// 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 details visit the link to understand content providers:

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

Sushil
  • 8,250
  • 3
  • 39
  • 71