java - how to stop progressbar spining after connection has been lost in android -
when pressed button on mobile phone after switch off wifi or mobile data network.
progress bar spinning not stop , button not work.
protected void onrefreshingstatechanged(boolean refreshing) { super.onrefreshingstatechanged(refreshing); if (!refreshing){ if (mprogressdialog != null && isbackpressed){ mprogressdialog.hide(); mprogressdialog = null; this.setresult(result_ok, getintent()); finish(); } }else{ if (mprogressdialog == null && isbackpressed){ mprogressdialog = progressdialog.show(this, "fetching data", "please wait while updating records ...", true); } } }
any appreciated.
try set cancelable
property of progressbar.
mprogressdialog = new progressdialog(this); mprogressdialog.setcancelable(true);
Comments
Post a Comment