Progressdialog ishowing returns true even called hide

I created a run dialog like this

public VolleyService(Context context, VolleyServiceCompletedListener listener){
    this.context = context;
    pDialog = new ProgressDialog(context);
    pDialog.setMessage("Loading...");
    pDialog.setCancelable(false);
    this.listener = listener;
}

and tried to show the execution dialog using this method.

private void showProgressDialog() {
    boolean isShowing = pDialog.isShowing();
    if (!isShowing)
        pDialog.show();
}

And hide this dialog using this method.

private void hideProgressDialog() {
    if (pDialog.isShowing()) {
        pDialog.hide();
    }
} 

The problem pDialog.isShowing()returns true even after I called pDialog.hide(). When I see the method hide()from android.app.Dialog.java, they do not set the variable mShowingto false, but when I call show(), they set the variable mShowingto true.

So is there any reason why they did not make false? And how can I reopen the same dialogue of progress?

+4
source share
2 answers

hide() use().

+6

.

pDialog.dismiss()
+2

All Articles