michael
michael

Reputation: 110510

In the oncreate() of my activity can I tell what intent launches my activity?

Android will call onCreate() of my activity whenever it is launched.

In the onCreate() of my activity can I tell what intent launches my activity?

Thank you.

Upvotes: 0

Views: 693

Answers (1)

dhaag23
dhaag23

Reputation: 6126

Simple - use getIntent(). You'll also want to override onNewIntent(Intent intent). I usually write a method called HandleIntent(Intent intent) and call it from both onCreate() and onNewIntent().

Upvotes: 3

Related Questions