Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7994569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:10:11+00:00 2026-06-04T14:10:11+00:00

There are posts that touch on this question, but no one that I can

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:10:14+00:00Added an answer on June 4, 2026 at 2:10 pm

    Possible solution:

    In application class:

    public static boolean firstStart = true;
    

    In Activity class:

    onCreate(){
       boolean firstStart = ((MyApplication)getApplicationContext()).firstStart;
       if (bHelpOnStart && firstStart) { startHelp(); }
    
       ((MyApplication)getApplicationContext()).firstStart = false;
    }
    

    Note this is not a good coding style, (better with singleton), but you should get the idea. Of course, if your application stays in memory and user open it again from launcher, it won’t display the firstStart; but at least when it go back from one activity (of your app) to the main one, it won’t show the help again. There’s no easy way to determine who starts your activity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've already noticed that there are many posts dealing with this; but I can't
There's probably 5 or 6 SO posts that tangentially touch on this, but none
My question is similar to this one , but is different enough that I
There are other posts that say you can create a control in windows forms
I have a method that posts HTTP data and displays a UIAlertView if there
I realize that this might be a duplicate question but this question is very
This is a question that I have been pondering for a long time ,
Is there any way to ensure that a class posts a particular NSNotification? (I
I know there's a lot of posts with the same that problem. I just
Although there are a lot of posts about .net config files, I believe that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.