I have many layouts that i wish to animate but with pause between them, can i do this without using threads?
final LinearLayout imagineL = (LinearLayout) findViewById(R.id.applayer);
final LinearLayout btneyeviewL = (LinearLayout)findViewById(R.id.eyeviewlay);
final LinearLayout btnonlineL = (LinearLayout) findViewById(R.id.onlinelay);
final Animation a = AnimationUtils.loadAnimation(this, R.anim.layanim);
a.reset();
imagineL.clearAnimation();
imagineL.startAnimation(a);
//pause for 1sec here
a.reset();
btneyeviewL.clearAnimation();
btneyeviewL.startAnimation(a);
//pause for 1sec here
a.reset();
btnonlineL.clearAnimation();
btnonlineL.startAnimation(a);
You can’t achieve this without using threads at all, as you are not allowed to keep the UI thread busy.
What you can, and probably should, do is use threads indirectly, by, for example, using AsyncTask, or a Timer.