Problems with the 'easy' first challenge


#1

I cant seem to keep the cheat value around after I rotate the cheat page after checking for the answer.
I can rotate the GeoQuiz Activity and it works fine. I know i am missing something stupid…help :smiley:
If i don’t rotate the cheat activity, its ok…

@Override protected void onActivityResult( int requestCode, int resultCode, Intent data) { if (data = = null) { return; } mIsCheater = data.getBooleanExtra( CheatActivity.EXTRA_ANSWER_SHOWN, false);

Hardy, Brian; Phillips, Bill (2013-03-29). Android Programming: The Big Nerd Ranch Guide (Big Nerd Ranch Guides) (Kindle Locations 2732-2735). Pearson Education. Kindle Edition.


#2

I think i got it, you setAnswerShownResult(); in the onCreate overide, on to number 3 [Save an array of indexes the cheater cheated on… :question: ]


#3

I think there is just the one boolean for cheating, not one for each question. Once you cheat, it is supposed to display the “Cheating is wrong” message for all subsequent attempts to answer any question. So, all you do is save the cheat flag just like the mCurrentIndex, to ensure it survives anything that destroys and recreates the main activity.


#4

That’s correct. (Although stashing a boolean for each individual question would be a pretty cool enhancement, too.)