Created
February 24, 2016 14:33
-
-
Save elsennov/9e73d2addcf526e4cc32 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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