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
Try Like this Way this is work for me:
Intent intent = new Intent(Activity3.this, FinishActivity.class);
intent.addFlags(android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
instead of your code
Intent intent = new Intent(Activity3.this, FinishActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();