我想在动画结束后设置按钮可见性.
这就是调用动画的原因:
android.support.v4.app.FragmentTransaction fAnimation = this.getActivity().getSupportFragmentManager().beginTransaction();
fAnimation.setCustomAnimations(android.R.anim.slide_in_left, R.anim.pull_out_to_left);
if (this.isVisible()) {
fAnimation.hide(this);
fAnimation.commit();
}
// code that will be executed when the fragment is gone (after the animation is over)
Run Code Online (Sandbox Code Playgroud)
有没有办法让听众知道我的片段何时消失?
我通过在创建片段时添加到一个包中将一个parcelable对象传递给一个片段.在onc实例中,对此parceled对象的修改反映了原始对象的修改,而在另一种情况下则不是.我对这种行为感到有点困惑.直到现在我已经假设通过一个包检索一个包围的对象总是创建一个新对象[不确定它是浅拷贝还是深拷贝].
有人请澄清可怜行为.