Converting String to Double in Android

前端 未结 8 660
感情败类
感情败类 2020-12-09 02:29

Trying to get double values from an EditText and manipulate them before passing them to another Intent. Not using primitive data type so I can use toString methods.

8条回答
  •  自闭症患者
    2020-12-09 02:47

    You seem to assign Double object into native double value field. Does that really compile?

    Double.valueOf() creates a Double object so .doubleValue() should not be necessary.

    If you want native double field, you need to define the field as double and then use .doubleValue()

提交回复
热议问题