views:

65

answers:

2

I used onKeyDown function in the activity.....but when back button button is clicked it first cancels the dialog box and goes to our activity...I want both either both activity and dialog box closed when clicking the back button or disable the back button when the dialog box is shown...

can any one suggest any solutions for this....

Thanks in advance,

+3  A: 

Did you try setting its setCancelable() property to false

Something like this

progressDialog.setCancelable(false); 
Rahul
A: 

Hello Thanks for your answer. The progressDialog with .setCancelable(false); is working fine.

But here I want different thing. When the progress dialog is running then i will press the BACK key and i want to show an alert dialog so that the user can notify that the progress is running.

Is there any solution about it?

Please help me.

Thanks in advance.

There is another thing with the progress dialog.That is when the progress dialog is running then if i touch on the screen without on the progress dialog. then is there any function to catch the event?