Android Question Msgbox background clicks

jpvniekerk

Active Member
Licensed User
Longtime User
I am picking up clicks on the background while a msgbox2 is open. It seems that clicks outside the msgbox2 panel is going through, resulting in some strange behavior of the app!

Is there a way to prevent clicks on the msgbox2 background - or catch them?
 

eps

Expert
Licensed User
Longtime User
Isn't msbgox2 modal? If it is or can be set to be you could catch them that way, otherwise put an invisible panel behind the msgbox2 and then catch them on that and do nothing with them - it's all about the Z
 
Upvote 0

jpvniekerk

Active Member
Licensed User
Longtime User
I use msgbox2 extensively for decisions by the user. My current app has about 100 of them! So adding an invisible panel will be very tedious.
I've figured that tapping outside the box returns -3 (same as DialogResponse.CANCEL) and I only had to make a couple of modifications to the app to eliminate strange behavior!
As far as I know msgbox2 is modal, but tapping outside the box returns the same as tapping the "cancel" item. It doesn't make sense to me (my logic is that tapping outside the box should do nothing), but I guess it is what it is and we just have to sometimes live the the nuances of Android!
 
Upvote 0

jpvniekerk

Active Member
Licensed User
Longtime User
If I remember correctly, the msgbox should be dismissed and return DialogResponse.CANCEL. Do you see a different behavior?
That is what it is doing - my logic just didn't expect anything to happen when you tap outside the box. What's the old saying - never ASS-U-ME anything :p
 
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
Hi jpvniekerk,

It seems that clicks outside the msgbox2 panel is going through, resulting in some strange behavior of the app!

You should have mentioned that "you want no-event when clicked outside msgbox", instead of saying "strange behavior".
At least give respect when others are trying to help you.

Regards,

Anand
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Ah - you said it was passing the click through - the behaviour you're now describing is fairly much as per all Android Apps I think. Although I know what you mean - it isn't ideal.
 
Upvote 0
Top