findViewById returns NULL when using Fragment

前端 未结 7 1875
终归单人心
终归单人心 2020-12-14 16:15

I\'m new to Android developing and of course on Fragments.

I want to access the controls of my fragment in main activity but \'findViewById\' returns null. without f

7条回答
  •  粉色の甜心
    2020-12-14 17:18

    If you want use findViewById as you use at activities onCreate, you can simply put all in overrided method onActivityCreated.

提交回复
热议问题