It is possible to add header and footer views to a list views.Are these views cached? Like the get view mechanism ensures recycling view resources for the list and prevents excess memory consumption.Is a header/footer view also taken care similarly?
EDIT
Consider a layout(which is essentially a ) with such contents:
Ideally a scroll view would be a suitable candidate for this. But this makes the choreographer complain about skipping a 1000 odd frames.
Another possible solution could be a a list view with headers and footers. A list view somehow consumes lower memory wrt the aforementioned scroll view.
The caching and parcelling questions was me trying to understand if there can be a mechanism for view storing/retrieving which would make inflation and relocing of listeners an easier task instead of a one-for-all-purpose method like getView()
EDIT2 I do not want to use a scroll view since it would inflate all the views in the start.Making the activity/fragment consume a lot of memory
It is possible to add header and footer views to a list views
yes ListView has the addFooterView and addHeaderView
Like the get view mechanism ensures recycling view reosurces for the list and prevents excess memory consumption. Is a header/footer view also taken care similarly?
No they are not.
In particular you can call both methods more than once. In this case you will have more footer/header views, and they will appear in the order of the insertion
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With