In my app I have a button to clear my TinyDB, what I need is opening a pop-up, asking the user "Do you really want to clear the DB?" and then act accordingly.
As far as I can see in the forum, there are (at least) a couple of possibilities:
- I add a notifer to my app which is specific to this. I use that notifier to show the ShowChooseDialog (btn1 = "Yes", btn2 ="No", Cancelable = false) and then I use its AfterChoosingEvent to decide what to do;
- I use just one notifier throughout my application, then I set a global variable "Reason" before showing the ShowChooseDialog to "DBCancelationConfirmation" and I fill in the AfterChoosingEvent with all the if-then-else I need to understand what choice (of the many that there could be in an app) is firing the AfterChoosingEvent. In this situation
Reason = "DBCancelationConfirmation"and I can act accordingly
I guess there are pro and cons in both solutions.
What would you suggest to manage a similar situation? Is it just a matter of taste or there is something behind that I'm missing?
Ciao,
Max
P.S.
I think I (and probably many newbies) would be happy to have a kind of "design pattern" repository giving the best choices to manage usual programming tasks in App Inventor. I know about the FAQ section but it's not the same thing...