The activities in stack are A,B1,B2,B3,B4. if i press back button in B4(activity) i should finish all the instances of B activity and it shoul开发者_如何转开发d take me to the A activity.
On B4 you should call the below method:
@Override
public void onBackPressed() {
startActivity(new Intent(this, A.class)
.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
return;
}
精彩评论