title: clearing activity stack android
body: <p>hi i've read many posts on stackoverflow on the subject but i still am not able to solve the problem.
  i need to clear my activity stack but the following comand doest work:</p>
  
  <pre><code>intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  </code></pre>
  
  <p>i also tried the following for api 15 android4.0.3</p>
  
  <pre><code>intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  </code></pre>
  
  <p>noting seems to work.</p>
  
  <p>here's the full method code</p>
  
  <pre><code>@Override
      public void onBackPressed() {
          super.onBackPressed();
  
          Intent intent = new Intent(this, FiltriAnagraficaPagina.class);
          intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
          startActivity(intent);
      }
  </code></pre>