设有Activity跳转历史 A->B->C->D。当前在D,想要跳到B,并得到A->B, 而不是A->B->C->D->B
则在跳转时要设置flag: Intent.FLAG_ACTIVITY_CLEAR_TOP
Intent intent = new Intent(D.this, B.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent);
详见:
http://blog.csdn.net/lvxiangan/article/details/42120951
时间: 2024-11-10 03:36:03