I have 2 custom ListView Created as item layout + ArrayAdapter + My own ListView class.
Then I’m using this ListView in my main layout next way:
<MyListViewFirst
android:id="@+id/MyListView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
This MyListViewFirst contains Layout1 with one text field (on the right) and the other ListView – MyListViewSecond inside:
<MyListViewSecond
android:id="@+id/MyListView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="18" />
When I see into Layout1 my TextView and MyListViewSecond are both fits the page not depending on how many rows MyListViewSecond contains.
But when I look into my main Layout at each MyListViewFirst element TextView does fit to the item, but MyListViewSecond doesn’t – it shows only a few elements.
Looks like it aligns to TextView height, and I need max height – MyListViewSecond with all inner items height.
So how can I get all items in the inner ListView be shown?
Example:

You really shouldn’t place a
ListViewinside anotherListView. It’ll give you bad performance and it’s not a good solution for users either – they’ll find it hard to use. I’d advise you to reconsider your design and implement it in a better way that doesn’t use nestedListViews.This isn’t an answer to your question, but I don’t think anyone would gain from an actual answer since your design implementation would be very inefficient, hard to use and against the Android design guidelines.
Maybe you should consider looking at the ViewPager, and see if you can somehow change your design to use that instead.