Nov
20
2007
0

Using android.widget.ArrayAdapter

I’m developing the universal converter on a new platform: Android
The 1st screen will be a ListActivity, if it’s an array of object, android.widget.ArrayAdapter would be very helpful.
Here’s a sample:

 private Vector<Type> types;
 public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        init();
        setListAdapter(new ArrayAdapter<Type>(this,
                android.R.layout.simple_list_item_1_small, types));
    }

android.R.layout.simple_list_item_1 and simple_list_item_1_small works fine with ArrayAdapter.

Written by hkai in: Android, Java, Mobile, Universal Converter |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes