错误:原因:java.lang.NullPointerException:尝试在空对象引用上调用虚拟方法'double java.lang.Double.doubleValue()'

时间:2018-12-31 03:17:25

标签: java android

定义双精度类型时会出现此错误 但是点击按钮保存时出现了道德错误

我已经尝试了几种不同类型的调用,什么也没做

public void save(View view){

        if ( validateFields() ){
            moviment = new Moviment();
            String date = fieldDate.getText().toString();
            Double valueRecovery = Double.parseDouble(fieldValue.getText().toString());

            moviment.setValue( valueRecovery );
            moviment.setCategory( fieldCategory.getText().toString() );
            moviment.setDescription( fieldDescription.getText().toString() );
            moviment.setDate( date );
            moviment.setType( "Expense" );

            Double expensA = totalExpense + valueRecovery;
            expenseAt( expensA  );

            moviment.save( date );

            finish();


        }


    }


The expected output is that it is saved in the firebase but causes this error

0 个答案:

没有答案