How to create the delay of 1 sec before set the alpha of View?

Shreyash Mahajan picture Shreyash Mahajan · Dec 7, 2011 · Viewed 51.5k times · Source

In My Application i am going to set the alpha after one animation. As like:

hideMenu = AnimationUtils.loadAnimation( getApplication(), R.anim.menu_layout_hide);
 menuLayout.startAnimation(hideMenu);
 menuLayout.setVisibility(View.GONE);

But i want to set the delay of 1 Sec before the Alpha set th the View. as Because of that i am not able to see the Animation of that layout. So How it is possibe ?

Thanks.

Answer

likebobby picture likebobby · Dec 7, 2011

Can't you use the

android:startOffset int. The amount of milliseconds the animation delays after start() is called.

in your animation xml?

See the animation resource documentation.