chi chi - 4 years ago 322
Android Question

Java.Lang.String in Integer cannot be applied to (android.Text.Editable) android studio

Try to take an integer and convert to EditText.

@BindView(R.id.goodQuantity)
EditText goodQuantity;

controller.save(new Item(Integer.parseInt(goodQuantity.getText())));


The error says

parse(int) Java.Lang.String in Integer cannot be applied to (android.text.Editable)

Answer Source

Get the text in String form, from EditText and than convert to Int:

controller.save(new Item(Integer.parseInt(goodQuantity.getText().toString())));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download