Although there is already a similar question, I did not clarify my question, my problem is as follows, the code below is Retrofit's onResponse, I'm starting now in Java, I'd like to play the response.body result in listView, I I got a string for the stringList.add code (countryList.get (i) .getNome ())) but I would like to know if there would be a better way to do it, I saw some examples using the Course, but my requests will return about 1400 lines so I do not know if using for can compromise the performance, I thought if there could be another more elegant way to do it, in the code below I tried to play the List with the direct response.body () in the ArrayAdapter, app returns the data like this:
public void onResponse(Call < List < Funcionarios >> call, Response < List < Funcionarios >> response) {
try {
List < String > stringList = new ArrayList < > ();
ListView lista = (ListView)findViewById(R.id.ListView);
TextView qtdtotal = (TextView) findViewById(R.id.textView);
List < Funcionarios > countryList = response.body();
ArrayAdapter adapter = new ArrayAdapter < > (getApplicationContext(), android.R.layout.simple_list_item_1, countryList);
lista.setAdapter(adapter)
} catch (Exception e) {
Log.d("onResponse", "There is an error");
e.printStackTrace();
}