I wrote code which can change background image random every 5 second.now i want to use fade in/out animation to change background image,but I do not know how I can use this
For fade in animation , create new folder named 'anim' in your res folder and inside it, create 'fade_in.xml' with following code
now to run this animation on your imageview, use following code in your activity
Animation anim = AnimationUtils.loadAnimation(YourActivity.this, R.anim.fade_in);
imageView.setAnimation(anim);
anim.start();
for fadeout animation, just swap values of android:fromAlpha and android:toAlpha
Hope this helps.