Code example for ViewSwitcher

Methods: showNext

0
	private class getMoreItems extends AsyncTask<Integer, Void, String> {
		 
		@Override 
		protected void onPreExecute() { 
			//first view is showing, show the second progress view 
			mSwitcher.showNext();
		} 
 
		@Override 
		protected String doInBackground(Integer... params) {
			//code to add more items 
			//... 
			try { 
				Thread.sleep(3000); 
				//only to demonstrate 
			} catch (InterruptedException e) {
				e.printStackTrace();
			} 
			return "List Item " + params[0];
		}