I have tried a lot of ways to trigger the backPressed() event when the progressDialog is displayed. But none works. If I provide progDialog.setcancelable(true); I am able to dismiss the progressDialog but still the onBackPressed() doesn’t get triggered.
I have tried a lot of ways to trigger the backPressed () event when
Share
When ProgressDialog is active if yiou press back key to perform yopur own operations you have to set
setOnCancelListenerto the progressdialog.write your logic inside
onCancel()method example the whole logic that you have written in onBackPressed() event those things you have to write here.Sample code
Thanks
Deepak