How to get text from EditText?

前端 未结 7 1898
旧时难觅i
旧时难觅i 2021-01-01 12:21

The question is quite simple. But I want to know where exactly do we make our references to the gui elements? As in which is the best place to define:

final          


        
7条回答
  •  一生所求
    2021-01-01 12:57

    in Kotlin 1.3

     val readTextFromUser = (findViewById(R.id.inputedText) as EditText).text.toString()
    

    This will read the current text that the user has typed on the UI screen

提交回复
热议问题