Fragment not attached to a context

前端 未结 7 1209
鱼传尺愫
鱼传尺愫 2020-12-14 14:58

In activity in Toolbar I got a button which need to call method from fragment and update list in that fragment. Now it is an error. Calling in activity

@Over         


        
相关标签:
7条回答
  • 2020-12-14 15:46

    In my case, this problem occurred when I was calling getString()

    changing this calls to getActivity().getString() solved the problem.

    0 讨论(0)
提交回复
热议问题