The problem is that your code is missing the state of the selected PREVIOUS ViewFlipper. I can only provide partial code, since I do not know the rest of your code.
in the class that contains the code snippet here, the public void onClick (View v) {"method, you want to have something like this:
public class Puzzle extends Activity{
in my code, look for "// changes" especially. you'll see that I used an integer to hold the previous flipper. and then, as I check, if this is the first time, I need to check if the previous flipper was -1 or not. then, at the end, make sure you set the current flipper identifier as the previous flipper identifier in order to update the βpreviousβ flipper identifier next time.
also note that I had a nested switch statement, because you need a bunch of extra checks to make your logic for what happens, depending on what the current and previous flippers are.
the answer to all my abilities regarding the information that I talked about (as well as to my knowledge), so I hope this helps.
PS I feel guilty, but if my answer was correct, please, please check my answer, because I really need some bonus points to ask questions about bonuses, but I do not think that I have enough points. thank you and happy holidays
source share