Hallo.
Ich habe für meine App einen Startbildschirm programmiert, der mit AnimationDrawable die Farben ändert.
Hier die background_animation_xml:
Code
		
					
			<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:drawable="@drawable/first_layer"
        android:duration="3500"/>
    <item
        android:drawable="@drawable/second_layer"
        android:duration="3500"/>
    <item
        android:drawable="@drawable/third_layer"
        android:duration="3500"/>
</animation-list>
Hier der Code in der MainActivity:
Code
		
					
			RelativeLayout myActivity;
AnimationDrawable animationDrawable;
myActivity = (RelativeLayout) findViewById(R.id.myActivity);
animationDrawable = (AnimationDrawable) myActivity.getBackground();
animationDrawable.setEnterFadeDuration(1500);
animationDrawable.setExitFadeDuration(3500);
animationDrawable.start();Das funktioniert auch. Allerdings hätte ich gerne, dass der Display sofort seine Farben verändert. Bei mir dauert es allerdings die 3,5 Sekunden. Geht das irgendwie, dass es sich sofort verändert?
 
		