Call of findViewById in Fragment to find a button returns null

前端 未结 4 1024
遥遥无期
遥遥无期 2021-01-19 00:54

I´m new to android development and I´m trying to write a small, simple Application. This application should do nothing more than reading the text from 2 EditTexts and when

4条回答
  •  长发绾君心
    2021-01-19 01:24

    You have to set the onClickListener inside the Activity from which you are managing the fragments and not inside the fragment, if the Button is not in the layout that your fragment is inflating.

提交回复
热议问题