I think the way you are looking is creating and populating your own list.
- create a main layout (mainLayout.xml) // It should have a linear layout at least one.
- create a template layout for your list rows.
- In your activity inflate your template in for loop, populate it and append it to your main layout.
here is an example,
listtemplate.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:id="@+id/listLayout"
android:clickable="true"
>
<TextView android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="3dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop ="true"
android:id="@+id/mainText"
android:text="TextView">
</TextView>
</RelativeLayout>
and in your activity,
public void CreateAndAppendListLayout()
{
List<String> mainList; //populate it...
LinearLayout mainLayout = (LinearLayout) findViewById(R.id.mainLayout);
LayoutInflater li = (LayoutInflater)getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
for (int i = 0; i < mainList.size(); i++){
View tempView = li.inflate(R.layout.listtemplate, null);
TextView textMain = (TextView) tempView.findViewById(R.id.mainText);
textMain.setText(mainList.get(i));
mainLayout.addView(tempView);
}
}