Skip to content

Instantly share code, notes, and snippets.

@elsennov
Created February 24, 2016 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elsennov/9e73d2addcf526e4cc32 to your computer and use it in GitHub Desktop.
Save elsennov/9e73d2addcf526e4cc32 to your computer and use it in GitHub Desktop.
@Override
public void onBackPressed() {
if (isTaskRoot()) {
startHomeActivity();
} else {
super.onBackPressed();
}
}
private void startHomeActivity() {
Intent intent = new Intent(this, ComposableActivity.class);
startActivity(intent);
finish();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment