Hi in my code when user press back button from mainactivity he/she exit from the application but problem is when user again press application icon it resume the mainactivity where i left it..... i want to restart my app again when user click on application icon. Thanks in advance
///exit from app by pressing back button
public void onBackPressed() {
Log.i("HA", "Finishing");
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
}