use of de.baumann.browser.Browser.Cookie in project browser by scoute-dich.
the class Whitelist_Cookie method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
switch(menuItem.getItemId()) {
case android.R.id.home:
finish();
break;
case R.id.whitelist_menu_clear:
final BottomSheetDialog dialog = new BottomSheetDialog(Whitelist_Cookie.this);
View dialogView = View.inflate(Whitelist_Cookie.this, R.layout.dialog_action, null);
TextView textView = dialogView.findViewById(R.id.dialog_text);
textView.setText(R.string.toast_clear);
Button action_ok = dialogView.findViewById(R.id.action_ok);
action_ok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Cookie cookie = new Cookie(Whitelist_Cookie.this);
cookie.clearDomains();
list.clear();
adapter.notifyDataSetChanged();
dialog.cancel();
}
});
Button action_cancel = dialogView.findViewById(R.id.action_cancel);
action_cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.cancel();
}
});
dialog.setContentView(dialogView);
dialog.show();
break;
default:
break;
}
return true;
}
Aggregations