Android Question Custom dialog close by code

Dario126

Member
Licensed User
Longtime User
On this forum I cant find solution how to close custom dialog.

I understand that's another activity above my activity, but it reacts on button clicks, and I can run code in button clicks sub while this dialog is shown.

Can this cub be used to close custom dialog without user clicks on yes/no/cancel? Maybe catch activity with reflector somehow?


I have some graphic options for user to select, and there is only one click necessary, and I don't want that user must select also ok after selection ..

Just tried this within one of button click sub, but it thoes not work..
B4X:
Dim r As Reflector
Dim a As Activity
a=r.GetActivity
a.Finish
 
Last edited:

LucaMs

Expert
Licensed User
Longtime User
I do not know which custom dialog you have used , but you can create your own: a panel having alpha = 0, another panel inside of it with your views. Then you make it .visible = true or false when you want (like dialog.show)

(activity above another one?)
 
Upvote 0

Dario126

Member
Licensed User
Longtime User
LucaMs, when I make it with another transparent panel, then clicks around my dialog form (transparent part of that background panel) goes on views that are under it. And I have another buttons around screen, so it's not ok if some other command is pressed when I'm expecting info from this dialog. How to avoid that ?
 
Upvote 0
Top