SamplesListpublic class SamplesList extends android.app.ListActivity
Fields Summary |
---|
static final String | KEY_NAME | static final String | KEY_CLASS | static final ArrayList | SAMPLES |
Methods Summary |
---|
static java.util.Map | makeSample(java.lang.String name, java.lang.Class activity)
Map<String,Object> ret = new HashMap<String,Object>();
ret.put(KEY_NAME, name);
ret.put(KEY_CLASS, activity);
return ret;
| protected void | onCreate(android.os.Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setListAdapter(new SimpleAdapter(this, SAMPLES,
android.R.layout.simple_list_item_1, new String[] { KEY_NAME },
new int[] { android.R.id.text1 }));
| protected void | onListItemClick(android.widget.ListView l, android.view.View v, int position, long id)
Class<?> clazz = (Class<?>) SAMPLES.get(position).get(KEY_CLASS);
startActivity(new Intent(this, clazz));
|
|