How to give animation to the ViewSwitcher
android, android-animation
Solution
Try setting animation inside xml as
<ViewSwitcher
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:inAnimation="@android:anim/slide_in_left"
android:outAnimation="@android:anim/slide_out_right" >
Problem
I have created one advertisement control which consists of ViewSwitcher.... in that control i have ImageView and TextView because advertisement are of either text or images.. Now i have to give animation to the advetisements.. I have tried following Animation inAnimation = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left); inAnimation.setDuration(1500); Animation outAnimation = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right); outAnimation.setDuration(1500); And i set it to the switcher as ViewSwitcher switcher; switcher.setInAnimation(inAnimation); switcher.setOutAnimation(outAnimation); but it won't work.. Please give me any other alternative.. Or if use of above code is wrong then how to use it??