Skip to content

Instantly share code, notes, and snippets.

@beilly
Created August 26, 2016 07:05
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 beilly/7fb2c10e7694b04e3c902cdea8dbc057 to your computer and use it in GitHub Desktop.
Save beilly/7fb2c10e7694b04e3c902cdea8dbc057 to your computer and use it in GitHub Desktop.
解决4.4机器上面按home键返回桌面后恢复需要重新走launcher页面的bug
if (!isTaskRoot()) {
Intent intent = getIntent();
String action = intent.getAction();
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && action != null && action.equals(Intent.ACTION_MAIN)) {
finish();
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment