Poblema with the Keyboard and Edittext

0

I have a edittext within a listview with a custom adapter, in that edittext I enter amounts and I have a textview where the sum of the input is displayed.

The problem is that when I enter an amount of a thousand or more to the keyboard fifth as I delete that amount, but if I do less than 1000 if I leave it.

I leave my validation code where I do the sum

public void afterTextChanged(Editable s)
    {

        //Abono = (EditText)view.findViewById(R.id.edt_abono);
       DetalleCxP O_DetalleCxP = (DetalleCxP)((EditText)view.findViewById(R.id.edt_abono)).getTag();
        O_DetalleCxP.TotalAplicado=ONC_SYS.NullToZeroDouble(s.toString());

        Double Total=0.0;
        for(int i=0;i<DetalleArrayList.size();i++)
        {
            if (((DetalleCxP)DetalleArrayList.get(i)).TotalAplicado>0)
            {
                Total += ((DetalleCxP)DetalleArrayList.get(i)).TotalAplicado;
            }
        }
        DecimalFormat numberFormat  = new DecimalFormat("###,##0.00");
        ((TextView)findViewById(R.id.Total)).setText(numberFormat.format(Total));

        if (Total==0)
        {
            ((Button)findViewById(R.id.pagoceros)).setEnabled(true);
            ((Button)findViewById(R.id.pago)).setEnabled(false);
        }
        else
        {
            ((Button)findViewById(R.id.pagoceros)).setEnabled(false);
            ((Button)findViewById(R.id.pago)).setEnabled(true);
        }

        //Validacion que no te deje hacer un abono Mayo al saldo vencido
        if (O_DetalleCxP.getSaldo() < O_DetalleCxP.TotalAplicado)
        {
            Toast.makeText(getApplicationContext(),"No puedes Aplicar un Abono Mayor al SaldoVencido",Toast.LENGTH_SHORT).show();
            ((EditText)view.findViewById(R.id.edt_abono)).setText("");

        }
    }
}
    
asked by Hugo Rodriguez 16.06.2016 в 17:46
source

0 answers