FileDocCategorySizeDatePackage
Gallery2.javaAPI DocAndroid 1.5 API2016Wed May 06 22:41:08 BST 2009com.example.android.apis.view

Gallery2

public class Gallery2 extends android.app.Activity

Fields Summary
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        setContentView(R.layout.gallery_2);

        // Get a cursor with all people
        Cursor c = getContentResolver().query(People.CONTENT_URI, null, null, null, null);
        startManagingCursor(c);
        
        SpinnerAdapter adapter = new SimpleCursorAdapter(this,
        // Use a template that displays a text view
                android.R.layout.simple_gallery_item,
                // Give the cursor to the list adatper
                c,
                // Map the NAME column in the people database to...
                new String[] {People.NAME},
                // The "text1" view defined in the XML template
                new int[] { android.R.id.text1 });

        Gallery g = (Gallery) findViewById(R.id.gallery);
        g.setAdapter(adapter);