overridePendingTransition

overridePendingTransition

我正在尝试使用overridePendingTransition从服务启动意图,它看起来像这样

    Intent dialogIntent = new Intent(this, PopUpMainActivity.class);
    dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    this.startActivity(dialogIntent);
    overridePendingTransition(R.anim.enter_anim, R.anim.exit_anim);


但是显示错误。

The method overridePendingTransition(int, int) is undefined for the type MyServiceForPopUp

最佳答案

不幸的是,您只能从活动中调用overridePendingTransition

此处有更多信息:
https://groups.google.com/d/msg/android-porting/M42HBc90hz4/HXz7aY1KqlYJ

08-16 22:00