Search code examples
androidfirebasefirebase-realtime-databasefirebaseui

Populate FirebaseAdapter with another results


I have a simple app where the user can structure his data into folders. I am working with FirebaseUI and I have created FirebaseRecyclerAdapter it works great (gj).

Is there any way to populate FirebaseRecyclerAdapter without reinitializing adapter everytime user goes into folder

Query ref = Database.getFolders()
            .orderByChild("parentid").equalTo(folderId);
    foldersAdapter = new FoldersAdapter(Folder.class, R.layout.item_folder, FoldersAdapter.FolderHolder.class, ref);
    //foldersAdapter.setOnProjectInsideClick(this);
    foldersList.setAdapter(foldersAdapter);

Solution

  • You can't change the database location that an existing FirebaseRecyclerAdapter shows. If you want to show data from a different location, you will have to create a new adapter.