我正在尝试使用 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
答案 0 :(得分:1)
很遗憾,您只能从活动中拨打overridePendingTransition
。
更多信息: https://groups.google.com/d/msg/android-porting/M42HBc90hz4/HXz7aY1KqlYJ