Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a custom dialog undismissable in android

I have a custom dialog which have 2 progress bars and a button on it. I am showing this dialog in onPreExecute ()of an AsyncTask and dissmissng it onPostExecute() the problem is that when ever i touch screen during the operation the dialog dissmiss. I want it to only dismiss when cancel button on dialog is pressed or downloading files is complete.

like image 544
Addy Avatar asked Jun 06 '14 10:06

Addy


1 Answers

You can use

dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);

reference

like image 159
Orhan Obut Avatar answered Sep 19 '22 21:09

Orhan Obut