Package 

Class FirebaseListAdapter

  • All Implemented Interfaces:
    android.widget.Adapter , android.widget.ListAdapter , android.widget.SpinnerAdapter , androidx.lifecycle.LifecycleObserver , com.firebase.ui.common.BaseChangeEventListener , com.firebase.ui.database.ChangeEventListener , com.firebase.ui.database.FirebaseAdapter

    
    public abstract class FirebaseListAdapter<T>
    extends BaseAdapter implements FirebaseAdapter<T>
                        

    This class is a generic way of backing an Android android.widget.ListView with a Firebase location. It handles all of the child events at the given Firebase location. It marshals received data into the given class type.

    See the READMEfor an in-depth tutorial on how to set up the FirebaseListAdapter.

    • Method Summary

      Modifier and Type Method Description
      void startListening() Start listening for database changes and populate the adapter.
      void stopListening() Stop listening for database changes and clear all items in the adapter.
      void onChildChanged(@NonNull() ChangeEventType type, @NonNull() DataSnapshot snapshot, int newIndex, int oldIndex)
      void onDataChanged()
      void onError(@NonNull() DatabaseError error)
      ObservableSnapshotArray<T> getSnapshots() Returns the backing ObservableSnapshotArray used to populate this adapter.
      T getItem(int position)
      DatabaseReference getRef(int position) Returns the reference at the specified position in this list.
      int getCount()
      long getItemId(int i)
      View getView(int position, @Nullable() View convertView, @NonNull() ViewGroup parent)
      • Methods inherited from class android.widget.BaseAdapter

        areAllItemsEnabled, getAutofillOptions, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver
      • Methods inherited from class android.widget.Adapter

        getCount, getItem, getItemId, getView
      • Methods inherited from class com.firebase.ui.common.BaseChangeEventListener

        onChildChanged, onDataChanged, onError
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait