How to get my activity context?

前端 未结 7 1745
小鲜肉
小鲜肉 2020-12-02 08:49

I don\'t really get the idea behind how this whole thing works really, so if I have some class A that need the context of a class B which extends <

7条回答
  •  被撕碎了的回忆
    2020-12-02 09:06

    you pass the context to class B in it's constructor, and make sure you pass getApplicationContext() instead of a activityContext()

提交回复
热议问题