While working on an issue of code that didn't run as I'd expected, I decided to build in a simple design time test.
This was to use a bool to check if a particular method had been previously run or not.
However I hit a problem that the bool seems to be always set to true - even after I specifically set it to false.
I know this can't be so, but :-
This bool variable is declared in MainActivity:
Boolean vmWordsHaveBeenPopulated = false;
This code running from a button click:
Even using the sledgehammer approach of resetting the boolean to false in that first line right before testing it doesn't seem to work because the result is always a text display of "Populated already".
That bool variable is not accessed anywhere else in the MainActivity (or any other) code.
It has me stumped. Why does it always return true?