Java.lang.IllegalStateException: Already attached

前端 未结 4 1526
Happy的楠姐
Happy的楠姐 2021-01-07 19:50

I\'m trying to build an app, that pastes an input from a previous activity(works with no problem) and then shows me some things from a database(when ButtonGet is pressed). T

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-07 20:25

    Problem is you first initialize textView1, and perform the button click, at that point you are just resetting any previous settings by calling onCreate() again, and before perfomClick methods hits getData() method, inside here also tries to access the text from textView1 but you called onCreate after that and set the view from scratch. That is why you cannot get it work, delete the duplicate code

提交回复
热议问题