I am developing the application in which i want to close whole application on button click. I know in android we should not think about to close the application because andr
This finally worked for me 100% of the time. I tried all of the flags standalone, never worked for all instances of the code. Used all the flags everywhere I want this functionality, about 5 different places, and it now works.
Intent intent = new Intent(actvSignIn.this, actvNearbyPlaces.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
finish();