When I click to edit my EditText in my list-view, the order of items change. I think the problem is on adapter, but I don't know how to fix it.
Ex.: The last item goes to second position.
Adapter:
public class adapterAvaliacao extends BaseAdapter {
private LayoutInflater mInflater;
private List<Nota> itens;
DecimalFormat formatoNota = new DecimalFormat("#0.00");
public adapterAvaliacao(Context context, List<Nota> itens) {
this.itens = itens;
mInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return itens.size();
}
@Override
public Nota getItem(int position) {
return itens.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@SuppressLint({ "ViewHolder", "InflateParams" }) @Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
Nota item = itens.get(position);
convertView = mInflater.inflate(R.layout.avaliacao_adapter, null);
((TextView) convertView.findViewById(R.id.lbl_nomeAtividade)).setText(item.getTitulo());
if (item.isLancada()) {
((EditText) convertView.findViewById(R.id.txt_notaPostada)).setText(String.valueOf(formatoNota.format(item.getNota() * 10 / item.getPeso())).replace(",", "."));
}
} else {
convertView.setTag(convertView.getTag());
}
return convertView;
}