Problem assigning an ArrayAdapter within an OnClick

0

Method:

spnCondPagamento.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
List listaCondPagamento = new ArrayList<>();
for (int i = 0; i < condPagDao.getListaCondPagamento().size(); i++) {
listaCondPagamento.add(condPagDao.getListaCondPagamento().get(i).getDescricao());
listaIdCondPag.add(condPagDao.getListaCondPagamento().get(i).getId());
}
ArrayAdapter condPagAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, listaCondPagamento);
condPagAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);
spnCondPagamento.setAdapter(condPagAdapter);

        }
    });

The problem is that it is showing erro :

  

ArrayAdapter condPagAdapter = new ArrayAdapter

asked by anonymous 24.12.2015 / 14:22

0 answers