在跳转位置设置SetFlags标记:
Intent in = new Intent(getActivity(), UIMain.class);
in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(in);
在Activity中对它进行调用处理:
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if ((Intent.FLAG_ACTIVITY_CLEAR_TOP & intent.getFlags()) != 0) {
finish();
System.exit(0);
}
}