-1

I have made slides using this library and its all working fine . I am calling my introduction slides right after Splash Activity.

And the Intro of my app starts easily using this awesome library. but then I got the problem

what I am doing

public void displayIntro() {
    List<Slide> slides = new ArrayList<>();

    for (int i = 0; i < 2; i++) {
        slides.addAll(generateSlides());
    }

    IntroductionBuilder introductionBuilder = new IntroductionBuilder(this);


    new IntroductionBuilder(this).withSlides(slides)
            .withOnSlideListener(defaultOnSlideListener).withSkipEnabled("Skip")
            .withPageTransformer(new ZoomOutPageTransformer()).introduceMyself();

}

this is how I am displaying slides after my splash screen time ends

My Problem:

If user click on any slide it goes back to my splash screen which is very bad, I want to disable the back button of the slides but do not know How to do this.

So My Real Question is

How Can I disable the back button(of Device not the one given on each slide), so that It can prevent going to splash screen. If I kill the splash screen , this will probably go to home screen of device .

Any possible solution ??

Allay Khalil
  • 674
  • 3
  • 11
  • 31

2 Answers2

0

Possible work-around is when you are navigating to slides from splash activity, call finish() before firing intent for slides. In that way, when user press back button while on slides, it'll be navigated back to Home Screen (Launcher app) not your splash screen i-e (logical flow).

Qasim
  • 5,181
  • 4
  • 30
  • 51
0

Try this out,

When you exit from splash screen then use finish() after Intent of AppIntro activity. so when user press back in app intro than you app exit instead of go to splash screen.

Intent myIntent = new Intent(splashActivity.this, AppIntroActivity.class);
startActivity(myIntent);
finish();
Rohit5k2
  • 17,948
  • 8
  • 45
  • 57
Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
  • I know this , but I do not wan tthis either – Allay Khalil Feb 11 '16 at 13:14
  • than what you want ? – Amit Vaghela Feb 11 '16 at 13:16
  • This seems to be a genuine solution. Why do you need Splash activity after Into activity has started. Doesn't make any sense to me. – Rohit5k2 Feb 11 '16 at 13:18
  • no I do not want this , I think you guys need to use this , generate slides , and then you would see that when you click on slides they would come back , if you have finished the splash activity before going to slides , then you would navigated to home , in both case I do not want to go anywhere either on home or on Splash. I just simply want that the slides stop taking back press – Allay Khalil Feb 11 '16 at 13:28