title: The proper way to handle "Up" Navigation according to guidelines
body: <p>I do totally agree with the Navigation below</p>
  
  <p><img src="https://i.stack.imgur.com/Z70Rj.png" alt="enter image description here"></p>
  
  <p>Imagine that the Book detail is made in different instances of a BookDetailActivity.</p>
  
  <p>The stack before pressing up in book2 detail is:</p>
  
  <ul>
  <li>BookDetailActivity (Book 2 - You are here)</li>
  <li>BookDetailActivity (Book 1)</li>
  <li>AllBooksActivity</li>
  </ul>
  
  <p>If I follow the <a href="http://developer.android.com/training/implementing-navigation/ancestral.html" rel="nofollow noreferrer">guidelines</a> I will use:</p>
  
  <pre><code>     Intent parentActivityIntent = new Intent(this, AllBooksActivity.class);
          parentActivityIntent.addFlags(
                  Intent.FLAG_ACTIVITY_CLEAR_TOP |
                  Intent.FLAG_ACTIVITY_NEW_TASK);
          startActivity(parentActivityIntent);
          finish();
  </code></pre>
  
  <p>But the big problem with this code is that BookDetailActivity (Book 1) is still alive!</p>
  
  <p>Pressing back button after "up" would bring the detail of Book 1.</p>
  
  <p>How can I kill all the <code>BookDetailActivity</code> that are between the original <code>AllBooksActivity</code> and the activity where I pressed up?</p>