It is necessary to apply the same animation to two widgets with a certain delay, but the setStartOffSet (delay) method used by me does not give the desired result. What's wrong?
res/anim: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromYDelta="750" android:toYDelta="0" android:duration="3000"> </translate> </set> java: public class MainActivity extends AppCompatActivity { ImageView mImage1; ImageView mImage2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mImage1 = (ImageView) findViewById(R.id.image_1); mImage2 = (ImageView) findViewById(R.id.image_2); Animation animation = AnimationUtils.loadAnimation(this, R.anim.trans_animation); mImage1.startAnimation(animation); animation.setStartOffset(1000); // НЕ РАБОТАЕТ ЗАДЕРЖКА?! mImage2.startAnimation(animation); } }