0 votes
1 view
in Java by (7.9k points)

I have an activity that is using the Theme.Dialog style such that it is a floating window over another activity. However, when I click outside the dialog window (on the background activity), the dialog closes. How can I stop this behaviour?

1 Answer

0 votes
by (39.8k points)

This could assist you. It is a way to manage the touch outside event:

How to cancel a Dialog themed like Activity when touched outside the window?

By grabbing the event and doing nothing, I think you can prevent the closing. But what is strange though, is that particular default behavior of your project dialog should be not to close itself when you touch outside.

(PS: the code practices WindowManager.LayoutParams)

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...