Added option to clear local contacts

pull/148/head
M66B 6 years ago
parent 38fc14722f
commit c4208d1a61

@ -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…
Cancel
Save