java - Android Progress Dialog doesn't show -


i want show progress dialog while i'm processing user's request. code , don't see reason why dialog not appearing on screen.

 public void ongoclick(button button) {     progressdialog progressdialog = null;     try {         if (invalid) {            //   show error message         } else {             progressdialog = new progressdialog(getactivity());             progressdialog.setindeterminate(true);             progressdialog.setmessage(getactivity().getresources().getstring(r.string.user_wait_message));             progressdialog.setprogressstyle(progressdialog.style_spinner);             progressdialog.show();              //  processing         }     } catch (exception ex) {         ex.printstacktrace();     } {         progressdialog.dismiss();     } } 

when move progressdialog declaration statement inside try block , removes dismiss method block, i'm able see circular dialog on screen, when change above code, nothing comes on screen. there no async calls in processing area, that's why don't find buggy here. appreciated, thanks.

your progress dialog shown , dismissed. block executed directly after try block.

try add ondismisslistener verify yourself.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -