
To load the entries we have used attribute on list view element which points to the resource defined in res/values/strings.xml. These items can be of any type and for this example we have used string (TextView object) as each item. In the XML layout file we have defined a ListView for displaying a scrollable list of items. Open main.xml file in res/layout and copy the following content. The element defines the list of strings that will be displayed as list item in the ListView layout. Fill in the application name column with LoginApp, then click next. Open res/values/string.xml and replace it with following content. We create a new project by clicking Start a new Android Studio project. Enter the Activity name as “ ListViewActivity1“.Create a new Android Project and name it as “ ListViewDemo“.Refer this link to setup the Android development environment.Android Development Tools (ADT) Plugin for Eclipse (ADT version 20.0.0).Eclipse Indigo IDE for Java EE Developers (3.7.1).Here, we are going to implement OnItemClickListener event listener which calls onItemClick() callback method where we retrieve and display the item selected by the user.This approach is good, if your list items are simple string values (TextView).

