I have a welcome screen that can be started as the first activity in my app, or it can be started by the main activity that the user spends their time in. I want it to act slightly differently when it's started from the home screen (or any other app) or the main activity.
Calling getCallingActivity()
in onCreate seems to always return null, regardless of what called the activity. This is strange, because it did work earlier, which is how I found what format the string returns in (which should be in the documentation anyway). I can't see what could have affected it, because the only thing that happens before calling getCallingActivity()
is calling super.onCreate(savedInstanceState)
. I am calling the activity with startActivityForResult(welcomeIntent, RESULT_WELCOME)
.
What am I doing wrong? Is there an alternative way to get this info?