The method findViewById(int) is undefined

前端 未结 4 843
被撕碎了的回忆
被撕碎了的回忆 2021-01-03 02:08

I\'m new to Android development and I\'m trying to code a little app which allows me to grab an external JSON file and parse it. I got this to work, however it wont work if

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-03 02:53

    findViewById is method in Activity class. You should pass instance of your activity to your LongOperation when you create it. Then use that instance to call findViewById.

提交回复
热议问题