M27Lab – Build Your Wordpress Website,Mobile App & Web Application

Remove all the previous activities from the back stack

intent.setFlags(
Intent.FLAG_ACTIVITY_NEW_TASK
|
Intent.FLAG_ACTIVITY_CLEAR_TASK
);

Reference: https://stackoverflow.com/questions/12947916/android-remove-all-the-previous-activities-from-the-back-stack