title: android app crash after adding actionbar.setsubtitle
body: <p>I tried to run my app (from bignerdranch) and could not run it after adding the following code:</p>
  
  <p><code>if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB) {
              ActionBar actionBar = getActionBar();
              actionBar.setSubtitle("Bodies of Water");
          }</code></p>
  
  <p>I get a runtime exception . If i remove these lines the app runs ok . 
  ofcourse i added the line @TargetApi(11)</p>
  
  <p>i tried changing my target sdk, i tried copying other people's code. nothing works!!</p>
  
  <p>this is my code : </p>
  
  <pre><code>private void updateQuestion() {
  
      int question = mQuestionBank[mCurrentIndex].getQuestion();
      mQuestionTextView.setText(question);
  }
  
  private void checkAnswer(boolean userPressedTrue) {
      boolean answerIsTrue = mQuestionBank[mCurrentIndex].isTrueQuestion();
      int messageResId = 0;
  
      if (mIsCheater[mCurrentIndex]) {
          messageResId = R.string.judgment_toast;
      } else {
          if (userPressedTrue == answerIsTrue) {
              messageResId = R.string.correct_toast;
          } else {
              messageResId = R.string.incorrect_toast;
          }
      }
      Toast.makeText(this, messageResId, Toast.LENGTH_SHORT).show();
  }
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (data == null) {
          return;
      }
      mIsCheater[mCurrentIndex] = data.getBooleanExtra(
              CheatActivity.EXTRA_ANSWER_SHOWN, false);
  }
  
  @TargetApi(11)
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      Log.d(TAG, "onCreate(Bundle) called");
      setContentView(R.layout.activity_quiz);
  
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB) {
          ActionBar actionBar = getActionBar();
          actionBar.setSubtitle("Bodies of Water");
      }
      mQuestionTextView = (TextView) findViewById(R.id.question_text_view);
  
      mTrueButton = (Button) findViewById(R.id.true_button);
      mTrueButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              checkAnswer(true);
  
          }
      });
  
      mFalseButton = (Button) findViewById(R.id.false_button);
      mFalseButton.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              checkAnswer(false);
  
          }
      }
  
      );
  
      mNextButton = (Button) findViewById(R.id.next_button);
      mNextButton.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              mCurrentIndex = (mCurrentIndex + 1) % mQuestionBank.length;
              // mIsCheater=false;
              updateQuestion();
  
          }
      });
  
      if (savedInstanceState != null) {
          mCurrentIndex = savedInstanceState.getInt(KEY_INDEX, 0);
          mIsCheater[mCurrentIndex] = savedInstanceState.getBoolean(CHEATED);
      }
  
      mCheatButton = (Button) findViewById(R.id.cheat_button);
      mCheatButton.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Intent i = new Intent(QuizActivity.this, CheatActivity.class);
              boolean answerIsTrue = mQuestionBank[mCurrentIndex]
                      .isTrueQuestion();
              i.putExtra(CheatActivity.EXTRA_ANSWER_IS_TRUE, answerIsTrue);
              startActivityForResult(i, 0);
          }
      });
      updateQuestion();
  
  }
  
  @Override
  public void onSaveInstanceState(Bundle savedInstanceState) {
      super.onSaveInstanceState(savedInstanceState);
      Log.i(TAG, "onSaveInstanceState");
      savedInstanceState.putInt(KEY_INDEX, mCurrentIndex);
      savedInstanceState.putBoolean(CHEATED, mIsCheater[mCurrentIndex]);
  }
  
  @Override
  public void onStart() {
      super.onStart();
      Log.d(TAG, "onStart() called");
  }
  
  @Override
  public void onPause() {
      super.onPause();
      Log.d(TAG, "onPause() called");
  }
  
  @Override
  public void onResume() {
      super.onResume();
      Log.d(TAG, "onResume() called");
  }
  
  @Override
  public void onStop() {
      super.onStop();
      Log.d(TAG, "onStop() called");
  }
  
  @Override
  public void onDestroy() {
      super.onDestroy();
      Log.d(TAG, "onDestroy() called");
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.quiz, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
      if (id == R.id.action_settings) {
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  </code></pre>
  
  <p>}
  `</p>
  
  <p>what could be the problem?</p>
  
  <p>please help me..</p>