I followed the tutorial at: http://mobile.tutsplus.com/tutorials/android/android-listview/
and was able to successfully run the application. It mainly uses a xml file called list_item.xml and its contents are
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="24dp"
android:padding="6dp" />
And in a file called TutListActivity.java, this xml is loaded as:
public class TutListActivity extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setListAdapter(ArrayAdapter.createFromResource(getApplicationContext(),
R.array.tut_titles, R.layout.list_item));
}}
AND THIS IS THE FIRST ACTIVITY WHICH GETS LOADED WHEN THE APPLICATION IS LAUNCHED FIRST. My requirement is TO CHANGE THE BACKGROUND VIEW OF THE COMPLETE SCREEN. When I tried android:background=@drawable/paperImage in the xml file list_item.xml, I was able to change the background image of each of the rows in the List and not the complete View. Can anyone help me out ?
just use the following lines written below with the id of your image after setListAdapter i hope this is what you want