I need to know, in the Application context, what launched my app (specifically, was it a natural launch -click on icon-, was it launched by a third partie app or through deep link, or was it from a Firebase push). Is there a way to know that ?
Asked
Active
Viewed 80 times
0
-
Related. http://stackoverflow.com/questions/5637876/differentiating-between-an-activity-launch-from-home-screen-or-from-another-acti – OneCricketeer Oct 27 '16 at 14:29
-
Not really, getIntent() is not accessible in the Application class. – Laetan Oct 27 '16 at 14:34
-
1Ah, well, the Application class doesn't handle the starting of any particular Activity. You can't get any Intent filters from it – OneCricketeer Oct 27 '16 at 14:54
1 Answers
1
Is there a way to know that ?
No.
I need to know, in the Application context, what launched my app
Then IMHO you have put too much in the Application
context. You are going to need to find some way of pushing the scenario-dependent logic into appropriate scenario-dependent entry points.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
Well, I am creating an SDK and I wanted to initialize it in the Application class (as I seen other SDK do), but I think i'll do it in the launcher activity if I can't. – Laetan Oct 27 '16 at 15:07