ArrayAdapter.add
works only if the dataset is a Collection, an ArrayList for instance.
Edit. That happens because that construct that takes a Java array as parameter convert it into a List through Arrays.asList. From the documentation Arrays.asList:
Returns a List of the objects in the specified array. The size of the List cannot be modified, i.e. adding and removing are unsupported, but the elements can be set. Setting an element modifies the underlying array.
Code from Android
public ArrayAdapter(Context context, int textViewResourceId, T[] objects) {
init(context, textViewResourceId, 0, Arrays.asList(objects));
}
Edit you should change from:
public PhotoAdapter(Context context, int layoutResourceId, Photo[] data)
to
public PhotoAdapter(Context context, int layoutResourceId, ArrayList<Photo> data)
and the rest of the code accordingly