The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.

Widget Catalog: AdapterViewFlipper

A regular ViewFlipper shows only one child widget or container at a time. So does an AdapterViewFlipper. The difference is where the children come from. With a regular ViewFlipper, you add children much like you would any other standard container class, such as defining the children in your layout XML resource. With AdapterViewFlipper, the children come from an Adapter.

While AdapterViewFlipper does not inherit from ViewFlipper (or vice versa, for that matter), their public API is largely the same:

There are two key advantages for AdapterViewFliper:

  1. Since it uses an Adapter model, it can be more memory efficient for lots of children, through child view recycling
  2. It is available for use in an app widget

However, AdapterViewFlipper is new to API Level 11 and is unavailable on older versions of Android. It is not included in the Android Support package backport.

Key Usage Tips

All of the usage tips from ViewFlipper are relevant for AdapterViewFlipper.

A Sample Usage

The sample project can be found in WidgetCatalog/AdapterViewFlipper.


<?xml version="1.0" encoding="utf-8"?>
<AdapterViewFlipper xmlns:android=""



import android.os.Bundle;
import android.widget.AdapterViewFlipper;
import android.widget.ArrayAdapter;

public class FlipperDemo2 extends Activity {
  static String[] items= { "lorem", "ipsum", "dolor", "sit", "amet",
      "consectetuer", "adipiscing", "elit", "morbi", "vel", "ligula",
      "vitae", "arcu", "aliquet", "mollis", "etiam", "vel", "erat",
      "placerat", "ante", "porttitor", "sodales", "pellentesque",
      "augue", "purus" };
  AdapterViewFlipper flipper;

  public void onCreate(Bundle state) {

    flipper.setAdapter(new ArrayAdapter<String>(this, R.layout.big_button, items));

Visual Representation

The preview of this section is en route to Mars.