abbanoob
abbanoob

Reputation: 216

Start Splash Screen after initial App intro launch

I implemented an app intro which when first launched, takes the user through an introduction of the application.

This app intro only shows at the initial first launch of the application and ceases afterward. Is there a way I can implement my splashscreen to where the splashscreen will launch for subsequent launches?

Upvotes: 0

Views: 387

Answers (1)

Adil Soomro
Adil Soomro

Reputation: 37729

Here're my recommendation:

  1. Always start your Splash screen as main Activity.
  2. In onResume() method of Splash screen, look for a boolean in your SharedPreferences against a key (let say "isFirstLaunch") indicating if the into has been shown before or not. If not, this is your first launch.
  3. Now immediately launch your Intro Activity if its first launch from onResume() of Splash activity, and override Intro Activity's onBackPressed() or onDestroy() or finish() or inside your custom button click listener to save the boolean into SharedPreferences indicating it has been shown.
  4. For every other launch, continue your normal flow of Splash.

This way, managing from Splash screen is easy.

Upvotes: 2

Related Questions