0

I have a recyclerview with firebase backend. I want to show latest item on top in my view. I just use setStackFromEnd(true); in my layoutmanager but its show error jutst like this

See Image

My minimum SDK Version is 16 and I used to <androidx.recyclerview.widget.RecyclerView

and this is my java code

MCC=FirebaseDatabase.getInstance().getReference().child("Troll");
    recyclerView = (RecyclerView) findViewById(R.id.TrollID_recyclerView);
    recyclerView.setHasFixedSize(true);
    layoutManager = new LinearLayoutManager(this);
    recyclerView.setLayoutManager(new GridLayoutManager(this, 1));

        LoadData(categoryId);

1 Answers1

1

you should store latest item first in recycleadapterList then your other items add to list. because recycleadapter show items like list item position

Muhammad Asad
  • 694
  • 6
  • 10