findViewById returns null in fragment

前端 未结 2 1665
温柔的废话
温柔的废话 2021-01-16 11:10

I have problem using the findViewByID methond in a fragment.

The spinner in Spinner spinner = (Spinner) view.findViewById(R.id.tabsearchspinner_location);

2条回答
  •  半阙折子戏
    2021-01-16 11:55

    Sorry, I just found out that I inflated the wrong layout, so the findViewById method always returns null, thanks for all the help though.

提交回复
热议问题