I am using FragmentStatePagerAdapter to show around 5 fragments in an activity.On each activity I am showing the images which I am fetching from FirebaseListAdapter/Firebase
ArrayList clientData = new ArrayList<>();
int j=0;
for (String h:profileImg)
{
ClientData clientItem = new ClientData();
clientItem.setProfileImage(h);
clientItem.setName(name[j]);
clientItem.setAddress(location[j]);
clientData.add(clientItem);
j++;
}
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplication(),RecyclerView.VERTICAL,false);
recy_client.setLayoutManager(layoutManager);
recy_client.setItemAnimator(new DefaultItemAnimator());
clientAdp = new ClientAdp(getApplicationContext(),clientData);
recy_client.setAdapter(clientAdp);
Replace From
clientAdp = new ClientAdp(context,clientData);
To
clientAdp = new ClientAdp(getApplicationContext(),clientData);
in my case