The Intent constructors parameters

前端 未结 3 1888
醉话见心
醉话见心 2021-02-19 06:52

The Intent class had 6 constructors

Intent()

Create an empty intent.


Inten

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-19 07:43

    Activity inherits context. Thus, if you are in an activity, you only need to pass itself to use the context. It also contains a pointer to getBaseContext(). You might occasionally need to reference that, if you need the entire application context, but most likely you won't for a while.

    You can find more details about the Activity class here.

    This question about the intent constructor parameters is similar to yours and has a really good answer. I think you'd like to check it out.

    Hope it helps.

提交回复
热议问题