title: NullPointerException warning after declaring 'FLAG_ACTIVITY_NO_ANIMATION'
body: <p>After defining <code>FLAG_ACTIVITY_NO_ANIMATION</code> for the back arrow in the action bar to correct to animation when the toolbar back arrow is clicked, a warning is then returned. What is the best way to get rid of this warning?</p>
  
  <blockquote>
    <p>Method invocation 'addFlags' may produce 'java.lang.NullPointerException'</p>
  </blockquote>
  
  <pre><code>@Override
  public boolean onOptionsItemSelected(MenuItem item) {
      if (item.getItemId() == android.R.id.home) {
          final Intent intent = getParentActivityIntent();
          intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
          onBackPressed();
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  </code></pre>