您好我正在开发小型Android应用程序,我试图通过Transition.TransitionListener().
监听窗口转换但是它没有给我的监听器方法回调。我试着这样做:
inside oncreate call registerTransitionListener()
private void registerTransitionListener() {
mEnterTransitionListener = new Transition.TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
Logger.print("inside transition start");
}
@Override
public void onTransitionEnd(Transition transition) {
Logger.print("inside transition end");
}
@Override
public void onTransitionCancel(Transition transition) {
Logger.print("inside transition cancel");
}
@Override
public void onTransitionPause(Transition transition) {
Logger.print("inside transition pause");
}
@Override
public void onTransitionResume(Transition transition) {
Logger.print("inside transition resume");
}
};
getWindow().getEnterTransition().addListener(mEnterTransitionListener);
}
但它不会在任何转换方法中打印任何日志。我的设备Android版本是5.0.2。需要知道它是如何工作的?需要一些帮助。谢谢。