I have a list view with some date and text in each row.Can I group this listView into groups as in iPhone with header between them.Is it possible in android. Please help. i.e I need to have header bar between the Listview rows so that rows below each header will become a group if I am grouping it using date.
A list view is an adapter view that does not know the details, such as type and contents, of the views it contains. Instead list view requests views on demand from a ListAdapter as needed, such as to display new views as the user scrolls up or down. In order to display items in the list, call setAdapter(android.
ListView listView = (ListView) findViewById(R. id. listview); listView. setAdapter(adapter);
Conclusion. While the ListView is still a very capable view, for new projects, I'll strongly advise you use RecyclerView, and consider the ListView as deprecated. I can't think of any situation where the ListView is better than the RecyclerView, even if you implement your ListView with the ViewHolder pattern.
Here are the plenty of articles for Android - ListView with Section from Google, from that i have listed out some of important articles/tutorials:
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