I want to create this project with my own list

-1

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.

    
asked by Alvaro Ubilla Oliva 08.05.2017 в 03:11
source

1 answer

0

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);
    
answered by 08.05.2017 / 03:44
source