I am a beginner in Android App Development. When I learned about RecyclerView and ListView, I understood that RecyclerView is better than ListView, but I am still confused about the name RecyclerView
and now have the following questions:
- Does the
RecyclerView
recycle only views or only references or both? - Does the
ListView
have the ability to recycle or reuse views by default? - What happens if there are 100 items, and getview() contains the following codes? Does ListView recycle or call getView() 100 times and then create a view?
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = getLayoutInflater();
View row = inflater.inflate(R.layout.custom, parent, false);
TextView title = (TextView) row.findViewById(R.id.title);
title.setText(Title[position]);
return row;
}
- If ListView implements the ViewHolder pattern, which will be more performant between ListView and RecyclerView?