原来一直以为这个功能不能实现,直到今天看了帖子,原来是这么实现的,真是太酷了
在要关闭的某个activity设置单例
public static PreviousActivity previousActivity;
public static PreviousActivity getInstance() {
return previousActivity;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
previousActivity = this;
}
在当前页拿到实例调用finish
PreviousActivity.getInstance().finish();