question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Show the Intro Once Not working

See original GitHub issue

Please check off the following things BEFORE submitting a new issue. Any issues that do not properly follow this format will be closed without discussion. If you’re requesting to have your app added to the list, you can erase the list and provide your app’s name and play store listing link. Thanks!

[ ] What you’ve tried (include code snippets, or whole files as necessary):

added the Show intro once example code to my splash screen

 //  Declare a new thread to do a preference check
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                //  Initialize SharedPreferences
                SharedPreferences getPrefs = PreferenceManager
                        .getDefaultSharedPreferences(getBaseContext());

                //  Create a new boolean and preference and set it to true
                boolean isFirstStart = getPrefs.getBoolean("firstStart", true);

                //  If the activity has never started before...
                if (isFirstStart) {

                    //  Launch app intro
                    Intent i = new Intent(SplashActivity.this, app_intro.class);
                    startActivity(i);

                    //  Make a new preferences editor
                    SharedPreferences.Editor e = getPrefs.edit();

                    //  Edit preference to make it false because we don't want this to run again
                    e.putBoolean("firstStart", false);

                    //  Apply changes
                    e.apply();
                }
            }
        });

        // Start the thread
        t.start();

[ ] What you thought should happen:

It should move from splashscreen activity to Main activity after the intro has been shown once

[ ] What actually happened:

unfortunately, it doesn’t go beyond the splashscreen activity. it freezes.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kennyung6commented, Jun 9, 2016

Okay Below is my Splash Activity and app_intro activity class.

Again, The Splash Activity is the first activity to be launched at start, then the app_intro activity (show only once - For 1st time use only), then to MainActivity. Thanks

SplashActivity.java

public class SplashActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent i = new Intent(SplashActivity.this, app_intro.class);
        startActivity(i);

    }
}

app_intro.java

public class app_intro extends AppIntro {

    @Override
    protected void onCreate (Bundle savedInstance) {

        super.onCreate(savedInstance);

        //Default App intro Settings
        addSlide(SampleSlide.newInstance(R.layout.intro));
        addSlide(SampleSlide.newInstance(R.layout.intro2));
        addSlide(SampleSlide.newInstance(R.layout.intro3));
        addSlide(SampleSlide.newInstance(R.layout.intro4));

        //Set Slide Animation
        setFadeAnimation();

        //Turn Vibration on & Intensity
        setVibrate(true);
        setVibrateIntensity(30);

        //setBarColor(Color.parseColor("#3F51B5"));
        setSeparatorColor(Color.parseColor("#2196F3"));
    }

    private void loadMainActivity() {

        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
    }

    @Override
    public void onSkipPressed(Fragment currentFragment) {
        super.onSkipPressed(currentFragment);
        loadMainActivity();
        Toast.makeText(getApplicationContext(),getString(R.string.skip), Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onDonePressed(Fragment currentFragment) {
        super.onDonePressed(currentFragment);
        loadMainActivity();
    }
}
0reactions
avluiscommented, Jun 16, 2016

Referencing this issue as it is related #250 If this issue has not being fixed, please reopen with something substantial.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to show the intro image only once - Stack Overflow
If you are willing to show the intro only when the user visits the page for the first time, here is a workaround:...
Read more >
How To Fix Xbox Game Bar Not Working/Not Opening in ...
In this video tutorial, I will show you guys how to fix Xbox Game Bar not working or Xbox gaming bar not opening...
Read more >
Program Won't Open? How to Fix Apps not ... - YouTube
Program won't open or program not opening in Windows 10? This video will show you how to fix programs, apps and games that...
Read more >
How to Fix Windows 11 Taskbar Not Working ... - YouTube
How to Fix Windows 11 Taskbar Not Working ? Taskbar Not Showing Issue ; 00:00 Intro ; 00:20 Restart Windows 11 ; 00:51...
Read more >
Fix Samsung Smart TV Apps Not Working, Crashing, Not ...
Fix Samsung Smart TV Apps Not Working, Crashing, Not Opening #SamsungTV #Apps # NotWorking Netflix, Youtube, Amazon Prime Video, Spotify, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found