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
I was using ProgressDialog
in a fragment and was getting this error on passing getActivity().getApplicationContext()
as the constructor parameter. Changing it to getActivity().getBaseContext()
didn't work either.
The solution that worked for me was to pass getActivity()
; i.e.
progressDialog = new ProgressDialog(getActivity());