А вот такой вариант не подойдет?
Это код активити:
public class TestActivity extends ListActivity {
private final static String TITLE_KEY = "title";
private final static String DESCRIPTION_LEY = "description";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
List<Map<String, String>> data = new ArrayList<Map<String, String>>();
int count = 10;
for (int i = 1; i <= count; i++) {
final HashMap<String, String> item = new HashMap<String, String>();
item.put(TITLE_KEY, String.format("Title %d", i));
item.put(DESCRIPTION_LEY, String.format("Description %d", i));
data.add(item);
}
setListAdapter(new SimpleAdapter(this, data, android.R.layout.simple_list_item_2, new String[] { TITLE_KEY,
DESCRIPTION_LEY }, new int[] { android.R.id.text1, android.R.id.text2 }));
}
}
А это код лейаута mail.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" />
<TextView
android:id="@android:id/empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="No data" />
</LinearLayout>