I've done this project with this tutorial: link , the.problem is this: I want to use my own list, instead of the list of countries as used in this tutorial.
I must say that I have no advanced knowledge in programming. I only learn with what I find.
I've done this project with this tutorial: link , the.problem is this: I want to use my own list, instead of the list of countries as used in this tutorial.
I must say that I have no advanced knowledge in programming. I only learn with what I find.
Simply change the values you pass to adapter
when you're creating it (class TabOneFragment
line 49)
adapter = new RVAdapter(mCountryModel);
In this case mCountryModel
is a list of CountryModel
, therefore you could do something like this:
mCountryModel = new ArrayList<>();
mCountryModel.add(new CountryModel("Pais 1", "Codigo 1");
mCountryModel.add(new CountryModel("Pais 2", "Codigo 2");
mCountryModel.add(new CountryModel("Pais 3", "Codigo 4");
adapter = new RVAdapter(mCountryModel);
recyclerview.setAdapter(adapter);