title: is there any method avalable to clear all my android app task(Activity Back stack) below 21?
body: <h1><em><strong>This question seems to be duplicate but it is not!</strong></em></h1>
  <p>I want to close my whole application in one shot.</p>
  <p>Note: My application may have multiple <strong>Activity Back Stack</strong></p>
  <p>For API level &gt;=21 bellow code working fine</p>
  <pre><code>ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
  if (activityManager != null) 
  {
       if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.LOLLIPOP) 
       {
           for (ActivityManager.AppTask appTask : activityManager.getAppTasks()) 
           {
                  appTask.finishAndRemoveTask();
           }
       }
  }
  </code></pre>
  <p><strong>I need code for below 21</strong></p>
  <blockquote>
  <p>I have tried the following solution listed bellow</p>
  </blockquote>
  <ol>
  <li><strong>finishAffinity()</strong> - <a href="https://developer.android.com/reference/android/app/Activity#finishAffinity()" rel="nofollow noreferrer">Official Doc First First Line</a>-&gt; Finish this activity as well as all activities immediately below it in the <strong>current task</strong> that have the same affinity, means it will clear current task not all the task</li>
  <li><strong>finishAndRemoveTask ()</strong> - <a href="https://developer.android.com/reference/android/app/Activity#finishAndRemoveTask()" rel="nofollow noreferrer">Official Doc</a> -&gt; not available below 21</li>
  <li><strong>System.exit(0)</strong> - not working</li>
  <li><strong>android.os.Process.killProcess(android.os.Process.myPid())</strong> - not working</li>
  </ol>