80,360
社区成员
发帖
与我相关
我的任务
分享
Intent intent = new Intent();
Intent spalshIntent = new Intent();
spalshIntent.setComponent(new ComponentName(getApplicationContext(),
SplashActivity.class));
spalshIntent.setAction("android.intent.action.MAIN");
spalshIntent.addCategory("android.intent.category.LAUNCHER");
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, spalshIntent);
sendBroadcast(intent);
这样也能完美解决,不过我还是不明白为什么.
if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
//结束你的activity
finish();
return;
}