My Activity is trying to create an AlertDialog which requires a Context as a parameter. This works as expected if I use:
AlertDialog.Builder builder = new Al
Just use following:
FOR JAVA USERS
In case you are using activity --> AlertDialog.Builder builder = new AlertDialog.Builder(this);
OR
AlertDialog.Builder builder = new AlertDialog.Builder(your_activity.this);
In case you are using fragment --> AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
FOR KOTLIN USERS
In case you are using activity --> val builder = AlertDialog.Builder(this)
OR
val builder = AlertDialog.Builder(this@your_activity.this)
In case you are using fragment --> val builder = AlertDialog.Builder(activity!!)