There are posts that touch on this question, but no one that I can find that really directly approaches it or solves it.
I have a main Activity that I want to call/create a help screen (it is really a second activity) when the user first gets into the app.
But, for users who are familiar with the app, I want to give them the option of not having that help screen every time at startup.
So, I set a preference in a SharedPreferences file. All the code works perfectly, including the SharedPreferences stuff (I can check this by looking at the CheckBox I have set up in the Settings screen I made to allow the user to opt out (or later in) to the opening help screen.)
Here is the code I have at the beginning of my onCreate() (override) method:
spSettings = getSharedPreferences(strPrefsFilename, 0);
bHelpOnStart = spSettings.getBoolean(strHelpParamName, true);
Then, I use simply:
if (bHelpOnStart)
{
// Show help screen.
}
The problem is that onCreate() for my main Activity is called every time I return from some other activity! I want my test for whether the help screen gets displayed to occur ONLY when the user comes to the app from "outside" it, specifically, from the Home->apps page.
Is there a method in Activity that is ONLY called when the Activity is come to from "outside" in the sense I just mentioned?
Thank you!