My application has the following flow:
Home->screen 1->screen 2->screen 3->screen 4->screen 5>Home->screen 2->Home->Screen 3
My problem is that when I am try
Use finishAffinity()
method that will finish the current activity and all parent activities. But it works only for API 16+
mean Android 4.1 or higher.
API 16+ use:
finishAffinity();
Below API 16 use:
ActivityCompat.finishAffinity(this); //with v4 support library
To exit whole app:
finishAffinity(); // Close all activites
System.exit(0); // Releasing resources