opened
HammadNasir
username_0
I am developing an android app in which I'm storing two different types of information on 'FirebaseDatabase`.

Then in the MainActivity, I'm retrieving them and showing to users in a RecyclerView. Both information are meant to be shown in different layouts, i.e., the layouts for both of them are different and that's why I have two make two different Model class and now have 2 different adapters.

So, what I did is I set the adapter on recyclerview in the same sequence as the information is fetched from database:

1.

```
public void prepareDataOfSRequests() {
        gModelClass = new GModelClass(postedBy, ***, ***, ***, "error", ***, formattedTime, currentLatitude, currentLongitude, utcFormatDateTime, userEmail, userID, null, ***, itemID);
        fastItemAdapter.add(0, gModelClass);
        recyclerView.setAdapter(fastItemAdapter);
        recyclerView.smoothScrollToPosition(0);
        emptyRVtext.setVisibility(View.INVISIBLE);
    }
```
2.

```
public void prepareDataOfERequests() {
        eModelClass = new EModelClass(***, ***, ***, ***, "error", ***, formattedTimeE, currentLatitudeE, currentLongitudeE, utcFormatDateTimeE, userEmailE, userIDE, null, ***, ***, ***, ***, itemID);
        fastItemAdapterER.add(eventRequestsModelClass);
        recyclerView.setAdapter(fastItemAdapterER);
        recyclerView.smoothScrollToPosition(0);
        emptyRVtext.setVisibility(View.INVISIBLE);
    }
```
as the recyclerview is only one and I'm setting 2 different adapters one by one, the recyclerview is getting updated with the 2nd adapter and showing only it's content.

So, how can I show or set both the adapter to the same 'RecyclerView' and can show the content stored in both the adapters.
How to set two adapters to one RecyclerView?
issue
created
HammadNasir
username_0
@username_2 are you going to resolve it, buddy?
comment
created
Rainer-Lang
username_1
Keep calm :)
comment
closed
mikepenz
username_2
issue
created
mikepenz
username_2
@username_0 your question is independent of the `FastAdapter`. Please refer to the official android documentation on what the `setAdapter` method does. Also the Android project is open source which allows you to check out the source code which will show you what happens with the `set` method. 

(a small tip on the side. `set` methods in general replace the value which was there previously. --> you can't have 2 adapters at once)

If you want to have all items shown at once. Just use one `ItemAdapter` and add the elements to it?!
comment
created
mikepenz
username_2
https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html#setAdapter(android.support.v7.widget.RecyclerView.Adapter)
comment