dialogAddB =  findViewById(R.id.addCatBtn);
        dialogAddB.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (dialogCatName.getText().toString().isEmpty())
                {
                    dialogCatName.setError("Enter Category Name");
                    return;
                }
                addNewCategory(dialogCatName.getText().toString());
            }
        });
I checked logcat and it shows that the exception is caused by null pointer from the code above
 
     
    