Hi,
I have four tabs that hold four listviews, I want to set a background for each list view but whenever I try to add the background it puts the image in each cell of the listview instead of behind the list.
?xml version="1.0" encoding="utf-8"?>
TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/pre"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:padding="10dp"
android:textSize="21sp">
/TextView>
I've realised that this is beacuse I've tried to add the background in a textview so it adds the image in each cell in the listview, so I have tried to add a linearlayout, listview and a imageview and put the background there but it force closes. I think this is becuse the tabhost uses main.xml to draw the main page and it conflicts, so I even tried to add the listview there still it nforce closes, it will only work if I have a textview only, howe can I add a background to each listview, below is the listview code;
public class prem extends ListActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
// Create an array of Strings, that will be put to our ListActivity
String[] names = new String[] { "Pre"};
ListView lv = getListView();
lv.setCacheColorHint(00000000);
lv.setAdapter(new ArrayAdapter<String>(this,
R.layout.list_item, names));
}