Code example for SimpleAdapter

0
 
        setListAdapter(new SimpleAdapter(this,
                getData(), 
                android.R.layout.simple_list_item_1,
                new String[] {"title"},
                new int[] {android.R.id.text1}));
    } 
     
    protected List getData()
    { 
        List myData = new ArrayList<Bundle>();
        addItem(myData, "Solid White", 0, 0xFFFFFFFF, 0xFF000000);
        addItem(myData, "Solid Light Gray", 0, 0xFFBFBFBF, 0xFF000000);
        addItem(myData, "Solid Dark Gray", 0, 0xFF404040, 0xFFFFFFFF);
        addItem(myData, "Solid Black", 0, 0xFF000000, 0xFFFFFFFF);
        addItem(myData, "Solid Blue", 0, 0xFF1a387a, 0xFFFFFFFF);
        addItem(myData, "Textured White", 0, 0, 0xFF000000);
        // addItem(myData, "Textured Blue", android.R.drawable.screen_background_blue, 0, 0xFFFFFFFF); 
 
        return myData;
    }