RecyclerView vs. ListView

RecyclerView was created as a ListView improvement, so yes, you can create an attached list with ListView control, but using RecyclerView is easier as it: Reuses cells while scrolling up/down – this is possible with implementing View Holder in the ListView adapter, but it was an optional thing, while in the RecycleView it’s the default way of writing adapter. Decouples list from its container – so you can … Read more

Android ListView headers

Here’s how I do it, the keys are getItemViewType and getViewTypeCount in the Adapter class. getViewTypeCount returns how many types of items we have in the list, in this case we have a header item and an event item, so two. getItemViewType should return what type of View we have at the input position. Android will then take care of passing you the right type of View in convertView automatically. Here what … Read more

RecyclerView vs. ListView

RecyclerView was created as a ListView improvement, so yes, you can create an attached list with ListView control, but using RecyclerView is easier as it: Reuses cells while scrolling up/down – this is possible with implementing View Holder in the ListView adapter, but it was an optional thing, while in the RecycleView it’s the default way of writing adapter. Decouples list from its container – so you can … Read more