Android Studio Screen - Block Completely Touch

Asked

Viewed 805 times

0

My question is the following, I have an Activity that finalizes an order and inserts the data of that request in the database and it takes a little time.... I wonder if there is any way to lock the touch to prevent the user to press some button, textEdit, spinner, listview and related that I have on the screen... I tried to set item by item, but the spinner and listview cannot lock. I wanted to disable the full touch of the screen during data transmission and only enable again when the transaction is over... Someone has an idea of a way to do this?

  • You can create a thread for insertion while rotating a dialog wait. Then you return to Handler and closes the dialog @Marcio

  • can disable touch in dialog? if you have the idea is genius

  • pq I have a dialog on another screen q if you click qlq place it closes

  • Yes, you have the option dialog.setCanceledOnTouchOutside(false)

  • For the dialog not to close, use setCancelable(false). But remember that when you finish, you have to give the Ismiss() of the Dialog.

  • I will test here and I return with the result.... Thanks for the idea =D

  • It worked perfectly..... If you had put as an answer I would evaluate you.... But thanks anyway... Thank you!!!!!

  • Just a warning in terms of UX: it’s a bad approach to stop the user from continuing to use the app because you’re making calls in the background. = D

Show 3 more comments

1 answer

2


You can create a thread for insertion while rotating a dialog wait. Then you return to Handler and closes the dialog. To disable the suspension of dialog use the command dialog.setCanceledOnTouchOutside(false)

  • It worked for me, simple and objective... Very good!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.