Code example for ViewFlipper

Methods: getChildCount, getDisplayedChild, showNext

0
					// user walked past end of wizard, so return okay 
					WizardActivity.this.setResult(Activity.RESULT_OK);
					WizardActivity.this.finish();
				} else { 
					// show next step and update buttons 
					flipper.showNext();
					updateButtons(); 
				} 
			} 
		}); 
 
		prev = (Button)this.findViewById(R.id.action_prev);
		prev.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				if(isFirstDisplayed()) { 
					// user walked past beginning of wizard, so return that they cancelled 
					WizardActivity.this.setResult(Activity.RESULT_CANCELED);
					WizardActivity.this.finish();
				} else { 
					// show previous step and update buttons 
					flipper.showPrevious();
					updateButtons(); 
				} 
			} 
		}); 
 
		this.updateButtons();
	} 
 
	protected boolean isFirstDisplayed() { 
		return (flipper.getDisplayedChild() == 0);
	} 
 
	protected boolean isLastDisplayed() { 
		return (flipper.getDisplayedChild() == flipper.getChildCount() - 1);
	} 
 
	protected void updateButtons() { 
		boolean eula = (flipper.getDisplayedChild() == 0);