Getting weird text back with EditText.toString() method in Android project. Why?

前端 未结 5 512
刺人心
刺人心 2020-12-11 13:08

I appear to have a fundamental gap in my understanding of an EditText object. I have an Activity+Layout with a single EditText object. After I type a few characters into t

5条回答
  •  余生分开走
    2020-12-11 13:52

    You are calling toString() on a View Object, which probably does not have a toString() defined.

    I believe you want to call this:

    editText.getText().toString()

提交回复
热议问题