Java generics incompatible types (no instance(s) of type variable(s) T exist)
ArrayList is an implementation of List interface. So all ArrayList instances are List instances but all List instances are not necessarily ArrayList. So when you call this method : public static <T> List<T> inRange(List<T> list, int index, int range) { you cannot assign its result to an ArrayList as you are doing : ArrayList<View> inRange … Read more