Challenges solved, but


#1

Ok, the challenge called for us to maintain the mIsCheater flag across device rotations in both activities, and if the user cycled through all the questions to clear the flag. I did take the last part of the challenge just a little farther, and maintained the state of mIsCheater for all questions no mater how many times the user rotated through the questions. If the user cheated on any question, the cheating toast was displayed for all questions the user cheated on. After I did all that, I thought of yet another way for the user to cheat and get away with it. If the user clicked the cheat button on a question again, but didn’t click the show answer button, then the mIsCheater flag would be set to false. I have 3 ways in mind to prevent the user from resetting mIsCheater this way. I wonder how many have the same idea.

Darren


#2

I’m very new to Java and Android Programming so I’m learning both as I go.

What I did to solve the cheat you mentioned was to add another i.putExtra in main activity with the mIsCheater boolean. On CheatActivity.java I grab the boolean extra just like I did with mAnswerIsTrue, and checked to see if it is true before running setAnswerShownResult(false).

I am having problem with the third challenge though. I’m still not familiar with manipulating all the components in java. Any tip?


#3

What I did to prevent the user from cheating by cycling through the questions was to create a boolean array that kept track of the cheat status of each question. I also had to save the array for device state changes, as it was getting re-initalized during onCreate when the device was rotated.