If User is clearing data of native contact storage app from setting then how can I detect that thing in my android application?
Is there any intent that is sent?
If User is clearing data of native contact storage app from setting then how can I detect that thing in my android application?
Is there any intent that is sent?
I don't think any intent will be triggered while clearing data of native contact app. But you can add content observer
in your app, which will notify your app on any contact modification(add/delete/update).
Refer, Content Observer
Here is the code snippet,
private class MyContentObserver extends ContentObserver {
public MyContentObserver() {
super(null);
}
@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);
}
}
MyContentObserver contentObserver = new MyContentObserver();
// Registers content observer
getContentResolver().registerContentObserver(Contacts.CONTENT_URI, false, contentObserver);