Skip to content

Instantly share code, notes, and snippets.

@vincent-paing
Created August 7, 2016 09:25
Show Gist options
  • Save vincent-paing/bf81ff09c9f745b28e60a069eacff357 to your computer and use it in GitHub Desktop.
Save vincent-paing/bf81ff09c9f745b28e60a069eacff357 to your computer and use it in GitHub Desktop.
private void loadData() {
swipeRefreshingLayout.setRefreshing(true);
FireBaseDatabaseManager.getHotelReference().addValueEventListener(new ValueEventListener() {
@Override public void onDataChange(DataSnapshot dataSnapshot) {
GenericTypeIndicator<List<Hotel>> tempIndicator = new GenericTypeIndicator<List<Hotel>>() {
};
hotelRecyclerAdapter.setItems(dataSnapshot.getValue(tempIndicator));
swipeRefreshingLayout.setRefreshing(false);
}
@Override public void onCancelled(DatabaseError databaseError) {
L.e(databaseError.getMessage());
swipeRefreshingLayout.setRefreshing(false);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment