package com.eni.android.listview;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ListViewEjemplo extends Activity {

	private String[] androidVersion = { "Cupcake", "Donut", "Eclair", "Froyo",
			"Gingerbread", "Honeycomb", "Ice Cream Sandwich" };
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		ListView myList = (ListView) findViewById(R.id.myList);
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, androidVersion);
		myList.setAdapter(adapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.list_view_ejemplo, menu);
		return true;
	}

}
