Toast in Fragment, should use getActivity() or getAcitivity().getApplicationContext()?

后端 未结 1 1033
孤城傲影
孤城傲影 2021-02-04 15:35

Sorry for my newbie Question, i just cannot find the answer from google and stackoverflow.. i just start learning for android, wish can build a good base for android knowledge.

相关标签:
1条回答
  • 2021-02-04 15:58

    For user interface related calls use the Activity context.

    See this explanation by Reto Meier: https://stackoverflow.com/a/987503/534471

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