Confusion on Challenge 8.1


In the challenge, it says to implement CrimeAdapter’s getItemViewType method to create two types of ViewHolders. Where is getItemViewType being explicitly called? I know that in CrimeAdapter’s onCreateViewHolder has a viewType parameter, so logically the result of getItemViewType being passed into that method, but I don’t understand where in the process thats happening.


You can check the implementations of the following two methods in

public class RecyclerView
boolean validateViewHolderForOffsetPosition(ViewHolder holder)
ViewHolder tryGetViewHolderForPositionByDeadline(int position, boolean dryRun, long deadlineNs)