How can i block UI from all interactions for some seconds by user in Android?
I would like to know, how to do this with some delay timing like wait(5000);
How can i block UI from all interactions for some seconds by user in Android?
I would like to know, how to do this with some delay timing like wait(5000);
Use ProgressDialog in UI Block time. Set ProgressDialog cancel-able false. So user do not able to access UI.
Thanks.
Show
Non-cancelable progress dialog
and close it by code when you want.......see example
http://www.helloandroid.com/tutorials/using-threads-and-progressdialog
As your Question is Short, you will get answer in that manner.
You can use Thread or AsyncTask for making some ProgressDialog being Visible for the User.
You can pop up a modal, non-cancelable progress dialog that blocks the user from doing anything. However, you should never block the UI thread itself.
You can override
dispatchTouchEvent
and stop the call tosuper.dispatchTouchEvent(ev);
Any touch event will have to go through this method before it is handled.Set a boolean that you control and use it in the method to determine whether you wish to block control.