Code example for ListView

Methods: getItemAtPosition

0
	} 
 
	@SuppressWarnings("unchecked") 
	@Override 
	protected void onListItemClick(ListView l, View v, int position, long id) {
		Map<String, Object> map = (Map<String, Object>) l.getItemAtPosition(position);
		Intent intent = new Intent(this, (Class<? extends Activity>)map.get("activity"));
		startActivity(intent);
	} 
 
	private List<? extends Map<String, ?>> getData() {
		List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
		addItem(data, "TextViews", FlipTextViewActivity.class);
		addItem(data, "Buttons", FlipButtonActivity.class);
		addItem(data, "Complex Layouts", FlipComplexLayoutActivity.class);
		addItem(data, "Async Content", FlipAsyncContentActivity.class);
		addItem(data, "Event Listener", FlipTextViewAltActivity.class);
		addItem(data, "Horizontal", FlipHorizontalLayoutActivity.class);
		addItem(data, "Issue #5", Issue5Activity.class);
		addItem(data, "XML Configuration", FlipTextViewXmlActivity.class);
		addItem(data, "Fragment", FlipFragmentActivity.class);