Skip to content Skip to sidebar Skip to footer

How To Show Progress Dialog In Non-Activity Class Inside List View

I have adapter class for Listview that is inside a class which is name AdapterItems that extended in ArrayAdapter. know how can I use progress dialog in this class that isn't exten

Solution 1:

Just pass the Activity Context to the Constructor of your non_activity class , then use that context to show your ProgressDialog

private Activity activityContext;

Public YourClassName(Activity activityContext)
{
  this.activityContext = activityContext;
}

then use this Context to initialize a ProgressDialog :

progressDialog = new ProgressDialog(activityContext);

Solution 2:

You have to pass

Activity Context

to your non activity class. And then use that context to display Dialog


Post a Comment for "How To Show Progress Dialog In Non-Activity Class Inside List View"