Code example for ArrayAdapter

0
	@Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        setListAdapter(new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, mStrings));
        getListView().setOnItemClickListener(this);
    } 
 
    private String[] mStrings = {"1. Simple", "2. Custom", "3. Tap close / Doubletap zoom"};
 
	@Override 
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		Intent intent = null;
		switch (position) {
		case 0: 
			intent = new Intent(this, SimpleMap.class);
			startActivity(intent);
			break; 
		case 1: 
			intent = new Intent(this, CustomMap.class);