How to add TextSwitcher with animation in Android using Java

A TextSwitcher is used to animate a text on a screen. It is the child class of the ViewSwitcher class. It contains only one child of type TextView. In order to set animation on TextSwitcher we have to add animation tag or we can add programtically. Here are the some usage of TextSwitcher: