mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Added option to clear local contacts
This commit is contained in:
parent
38fc14722f
commit
c4208d1a61
2 changed files with 28 additions and 0 deletions
|
@ -170,6 +170,31 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
|
|||
}
|
||||
});
|
||||
|
||||
drawerList.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
||||
@Override
|
||||
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
DrawerItem item = (DrawerItem) parent.getAdapter().getItem(position);
|
||||
if (item.getId() == R.string.menu_privacy) {
|
||||
new SimpleTask<Void>() {
|
||||
@Override
|
||||
protected Void onExecute(Context context, Bundle args) {
|
||||
int count = DB.getInstance(context).contact().clearContacts();
|
||||
Log.i("Cleared contacts=" + count);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
Helper.unexpectedError(ActivitySetup.this, ActivitySetup.this, ex);
|
||||
}
|
||||
}.execute(ActivitySetup.this, new Bundle(), "setup:privacy");
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
PackageManager pm = getPackageManager();
|
||||
DrawerAdapter drawerArray = new DrawerAdapter(this);
|
||||
|
||||
|
|
|
@ -55,4 +55,7 @@ public interface DaoContact {
|
|||
|
||||
@Update
|
||||
int updateContact(EntityContact contact);
|
||||
|
||||
@Query("DELETE from contact")
|
||||
int clearContacts();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue