Added option to clear local contacts

This commit is contained in:
M66B
2019-02-17 16:45:19 +00:00
parent 38fc14722f
commit c4208d1a61
2 changed files with 28 additions and 0 deletions

View File

@@ -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);