Code example for TextSwitcher

Methods: setText, setVisibility

0
	public class AnimationSwitcher extends AsyncTask<Void, Integer, Void> {
 
		@Override 
		protected void onPreExecute() { 
			textSwicher1.setVisibility(View.GONE);
			textSwicher2.setVisibility(View.GONE);
			textSwicher1.setText("");
			textSwicher2.setText("");
			imageSwitcher1.setVisibility(View.VISIBLE);
		} 
 
		@Override 
		protected Void doInBackground(Void... params) {
			publishProgress(-2); 
			SystemClock.sleep(1200);
			publishProgress(-1); 
			SystemClock.sleep(1200);
			publishProgress(0); 
			SystemClock.sleep(1300);
			publishProgress(1); 
			SystemClock.sleep(2000);