Often I need to setup the states of various views that have a "view_changed" event sub associated to them.
For example, when I initially display a "Settings" screen, I need to pre-set the user-selected state of the various option views, but I don't want to trigger their respective change event so it will not run code that I do not want to run at that time.
What is the best practice to do this?
I've been using a "Loading" boolean variable that I set true in the activity_create sub and then add code in each event sub to check this var and immediately exit the sub if it's true (so the sub's event code won't run). And then clear this flag at the end of the activity_create sub.
But is this 100% reliable in a world of async operations?
For example, when I initially display a "Settings" screen, I need to pre-set the user-selected state of the various option views, but I don't want to trigger their respective change event so it will not run code that I do not want to run at that time.
What is the best practice to do this?
I've been using a "Loading" boolean variable that I set true in the activity_create sub and then add code in each event sub to check this var and immediately exit the sub if it's true (so the sub's event code won't run). And then clear this flag at the end of the activity_create sub.
But is this 100% reliable in a world of async operations?