Lau
Lau

Reputation: 1834

Android Content Resolver delete - update status

Is it possible to get notified when I delete an element using ContentResolver?

For example, if I execute this:

context.getContentResolver().delete(SMS_URI, null, null);

it returns the number of rows deleted. But if I delete 10k element it might take some time. I want to update progressbar during deleting and I think that deleting it one by one might be not optimal solution.

Upvotes: 0

Views: 496

Answers (1)

Andrei T
Andrei T

Reputation: 3083

As you can look at the documentation all one has to do is to add:

 context.getContentResolver().notifyChange(SMS_URI, null);

Some example for a better understanding:
Android Tutorial: Writing your own Content Provider

Upvotes: 2

Related Questions