I want to access a list from another class then put it inside my RecyclerViewAdapter
object .
The first class which contains the list.
public class Class1 {
// The List :
List<Model1> mlisto = new ArrayList<>();
mlisto.add(new Model1("HOLA","Dep17",R.drawable.img));
mlisto.add(new Model1("bonjour","Dep17",R.drawable.img));
mlisto.add(new Model1("hi","Dep17",R.drawable.img));
}
The second class which access the list from the first class.
public class Class2 {
RecyclerViewAdapter adapter = new RecyclerViewAdapter(this,new Class1().mlisto);
}
When I use new Class1().mlisto
it returns nothing like an empty list
and the RecyclerView
doesn't show anything on the app.