Für jetzt habe ich ein Problem mit einer Animation im Dialogfeld. Ich habe Animation hinzufügen, wie folgt aus:Reverse-Animation in AndroidDialog auf Zurück-Taste gedrückt
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().getAttributes().windowAnimations = R.style.DialogTheme_Animate;//setWindowAnimations(R.style.DialogTheme_Animate);
}
Animation, sieht wie folgt aus:
<style name="DialogTheme.Animate" parent="@android:style/Animation.Activity">
<item name="android:windowEnterAnimation">@anim/slide_in_right</item>
<item name="android:windowExitAnimation">@anim/slide_out_left</item>
</style>
Auf Zurück-Taste gedrückt I Animation mit umgekehrtem Animation ändern:
<style name="DialogTheme.Animate.Back" parent="@android:style/Animation.Activity">
<item name="android:windowEnterAnimation">@anim/slide_in_left</item>
<item name="android:windowExitAnimation">@anim/slide_out_right</item>
</style>
nenne ich Ändern hier:
@Override
public void onBackPressed() {
getWindow().getAttributes().windowAnimations = R.style.DialogTheme_Animate_Back;
super.onBackPressed();
}
Aber Animation wird nicht geändert.
Wie kann ich eine Animation im Dialog ändern, wenn ein Ereignis kommt? Ist es möglich? Vielen Dank!