Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android contentView disable user interaction?

I want to disable the user interaction in an activity so that the user cannot touch the view/ subviews inside the content view of the activity. Is there any way to achieve this?

like image 559
Mahadevan Sreenivasan Avatar asked Apr 19 '26 21:04

Mahadevan Sreenivasan


1 Answers

You can add a blank dialog on top of your activity like this:

overlayDialog = new Dialog(context, android.R.style.Theme_Panel);
overlayDialog.show();

and when you don't need it any more, call

 overlayDialog.dismiss();
like image 59
guinetik Avatar answered Apr 22 '26 23:04

guinetik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!