I found this code snippet to programmatically go to the home screen on clicking the back button.
public void onBackPressed() {
Intent a = new Intent(Intent.ACTION_MAIN);
a.addCategory(Intent.CATEGORY_HOME);
a.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(a);
}
What is the purpose of using setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
?