app首次安装完成后在安装界面直接“打开”应用再按home键返回
作者:
wangmf | 来源:发表于
2020-10-27 15:14 被阅读0次 @Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.SplashTheme);
super.onCreate(savedInstanceState);
//首次安装按home键置入后台,从桌面图标点击重新启动的问题
if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
finish();
return;
}
if (!isTaskRoot()) {
final Intent intent = getIntent();
final String intentAction = intent.getAction();
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && intentAction != null && intentAction.equals(Intent
.ACTION_MAIN)) {
finish();
return;
}
}
setContentView(R.layout.view_new_home);
}
本文标题:app首次安装完成后在安装界面直接“打开”应用再按home键返回
本文链接:https://www.haomeiwen.com/subject/unrxvktx.html
网友评论