Posts

Showing posts from November, 2012

Simple List Activity

Image
Java Class of src folder where : import android.os.Bundle; import android.app.Activity; import android.app.ListActivity; import android.content.ClipData.Item; import android.view.Menu; import android.widget.ArrayAdapter; public class List extends ListActivity { private String[] listItems = new String[] { "Apple", "Android", "Symbian", "Window" }; private ArrayAdapter< String> adapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); adapter = new ArrayAdapter (this, R.layout.list, R.id.text1, listItems); setListAdapter(adapter); } } List Items are Displayed in Text View . So create new XML file in res Layout Folder and simple copy the XML code. The Following are the Main layout "activity_list" file