[Solved] OnClickListner unfortunately has stopped


The views of a dialog cannot be accessed directly. Please do like this:-

final AlertDialog dialog = new AlertDialog.Builder(this, R.style.Theme_AppCompat_Light_Dialog_Alert);
dialog.setContentView(R.layout.popup);
groceryItem = view.findViewById(R.id.groceryItem);

//Similarly, do for other views

2

solved OnClickListner unfortunately has stopped