Since finishAffinity() was only introduced in API 16, but my app targets 14+. How do I get this to work for 14+?
Thank you!
finishAffinity() : finishAffinity() is not used to "shutdown an application". It is used to remove a number of Activities belonging to a specific application from the current task (which may contain Activities belonging to multiple applications).
Delete all activity On your Android phone or tablet, go to myactivity.google.com. Above your activity, tap Delete .
You must call the second activity using the startActivityForResult method. In your second activity, when it is finished, you can execute the setResult method where basically you put the result information. Then, on your first activity, you override the onActivityResult method.
Use this line of code: System. exit(1);
Got it.
Use ActivityCompat.finishAffinity(this); (with v4 support library)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With