How to get my activity context?

前端 未结 7 1744
小鲜肉
小鲜肉 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:09

    The best and easy way to get the activity context is putting .this after the name of the Activity. For example: If your Activity's name is SecondActivity, its context will be SecondActivity.this

提交回复
热议问题