/** * @param activity The activity containing the ListView * @param modelClass Firebase will marshall the data at a location into an instance of a class * that you provide * @param modelLayout This is the layout used to represent a single list item. You will be * responsible for populating an instance of the corresponding view with the data from an * instance of modelClass. * @param ref The Firebase location to watch for data changes. Can also be a slice of a location, * using some combination of <code>limit()</code>, <code>startAt()</code>, and <code>endAt() * </code>, */ public FirebaseListAdapter(Activity activity, Class<T> modelClass, int modelLayout, Query ref) { mModelClass = modelClass; mLayout = modelLayout; mActivity = activity; mSnapshots = new FirebaseArray(ref); mSnapshots.setOnChangedListener( new FirebaseArray.OnChangedListener() { @Override public void onChanged(EventType type, int index, int oldIndex) { notifyDataSetChanged(); } }); }