I am trying to show a ProgressDialog within a Fragment class. The following code just works within an Activity class but not for
ProgressDialog
Fragment
Activity
ProgressDialog take Context input so use getActivity() in object creation.
Context
getActivity()
ProgressDialog dialog = ProgressDialog.show(getActivity(), "Loading...", "Please wait...", true);
Try this in Fragment
nDialog = new ProgressDialog(getActivity());