Difference between two intents

(QuizActivity.java)

mCheatButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//Start Cheating
boolean answerIsTrue = mQuestionBank[mCurrentIndex].isAnswerTrue();
Intent i = new Intent(MainActivity.this, CheatActivity.class);
i.putExtra(EXTRA_ANSWER_IS_TRUE, answerIsTrue);
startActivityForResult(i, REQUEST_CODE_CHEAT);

//why are we using below code in book when above written code works fine
//just to save a line of code in GeoQuiz.Activity or there is something I didn’t understand
/*
boolean answerIsTrue = mQuestionBank[mCurrentIndex].isAnswerTrue();
Intent i = CheatActivity.newIntent(MainActivity.this, answerIsTrue);
startActivityForResult(i, REQUEST_CODE_CHEAT);
*/

        }
    });

(CheatActivity.java)

public static Intent newIntent(Context packageContext, boolean answerIsTrue){
Intent i = new Intent(packageContext, CheatActivity.class);
i.putExtra(EXTRA_ANSWER_IS_TRUE, answerIsTrue);
return i;

Hi Gill,

The following link explained your question well.

question-about-newintent-method

I am about to finish the book, now I know what is the difference . Anyways thanks Crytal.