title: How to use IntentCompat.makeRestartActivityTask()?
body: <p>I'm trying to implement a button that will result in my app going back to the first activity and acting as if it was (almost) restarted all over. This code</p>
  
  <pre><code>Intent newIntent =
          new Intent(currentActivity.getApplicationContext(), StartActivity.class);
  newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + Intent.FLAG_ACTIVITY_CLEAR_TASK);
  currentActivity.startActivity(newIntent);
  </code></pre>
  
  <p>seems to be working OK for a newer tablet that is running Android 4.1, but it doesn't work on an older device that is running Android 2.3.4.</p>
  
  <p>I've found a couple of threads about this:</p>
  
  <p><a href="https://stackoverflow.com/questions/14341294/intent-flag-activity-clear-taskintent-flag-activity-new-task-not-working-androi">Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK not working Android</a></p>
  
  <p><a href="https://stackoverflow.com/questions/5979171/clear-all-activities-in-a-task">Clear all activities in a task?</a></p>
  
  <p>Reading the fine print leads me to believe I should be using the IntentCompat class in android-support-v4.jar, <a href="http://developer.android.com/reference/android/support/v4/content/IntentCompat.html" rel="nofollow noreferrer">http://developer.android.com/reference/android/support/v4/content/IntentCompat.html</a></p>
  
  <p>Unfortunately, the documentation does not contain any examples, and I'm very unsure of how I should be using IntentCompat. The only example I've found is this: <a href="https://stackoverflow.com/questions/15273528/not-start-mainactivity-with-android-2-3">Not start MainActivity with android 2.3</a></p>
  
  <p>which leads me to believe I should be doing something like this:</p>
  
  <pre><code>    Intent newIntent = IntentCompat.makeRestartActivityTask(cn);
  </code></pre>
  
  <p>But this is giving me a compiler error, saying "makeRestartActivityTask" is an undefined symbol. </p>
  
  <p>I'm guessing this implies I haven't added android-support-v4.jar correctly to my build environment (IntelliJ IDEA 12 community edition), but I've tried doing that in several different ways, and it still doesn't work. </p>
  
  <p>So I have two questions:</p>
  
  <ol>
  <li><p>Does my attempted usage of IntentCompat look correct?</p></li>
  <li><p>How do I get the compiler to stop saying that "makeRestartActivityTask" is an undefined symbol?</p></li>
  </ol>