Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen rotation resets intro slides in splash screen demo #58

Closed
Sleeper9 opened this issue May 30, 2016 · 5 comments
Closed

Screen rotation resets intro slides in splash screen demo #58

Sleeper9 opened this issue May 30, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@Sleeper9
Copy link

Whenever I rotate the screen during the intro slides, the intro starts again at the initial position. I follow the example code and add my slides in onCreate(). I tried to wrap the code into a
if (null == savedInstanceState) { ... }, but then I get an exception:

java.lang.IndexOutOfBoundsException: Invalid index 2, size is 0
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2689)
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2754)
 android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4458)
 android.app.ActivityThread.access$1000(ActivityThread.java:177)
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1454)
 android.os.Handler.dispatchMessage(Handler.java:102)
 android.os.Looper.loop(Looper.java:145)
 android.app.ActivityThread.main(ActivityThread.java:5938)
 java.lang.reflect.Method.invoke(Native Method)
 java.lang.reflect.Method.invoke(Method.java:372)
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
by: java.lang.IndexOutOfBoundsException: Invalid index 2, size is 0
 java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
 java.util.ArrayList.get(ArrayList.java:308)
 com.heinrichreimersoftware.materialintro.slide.SlideAdapter.getBackground(SlideAdapter.java:93)
 com.heinrichreimersoftware.materialintro.app.IntroActivity.getBackground(IntroActivity.java:752)
 com.heinrichreimersoftware.materialintro.app.IntroActivity.updateBackground(IntroActivity.java:367)
 com.heinrichreimersoftware.materialintro.app.IntroActivity.onPostCreate(IntroActivity.java:125)
@janheinrichmerker
Copy link
Owner

Can't confirm this on material-intro 1.5.1 running Nexus 5X Android N

@Sleeper9
Copy link
Author

I just checked out the latest master and this problem appears on Nexus 7 @ Android 6.0.1 (and other lower API levels like 5.0, 4.x as well). Here is a sample gif recording of the Fake splash screen functionality; I rotate the screen two times and pressing the device Back button several times then. You
can see that the "older" intro screens are still there after I finish a rotated one.

ezgif-3645377597

@janheinrichmerker
Copy link
Owner

Yep this is most likely a problem with the splash screen demo as this issue doesn't occur when starting an intro manually e.g. when pressing "Start intro" in the demo.

@janheinrichmerker janheinrichmerker changed the title Screen rotation resets intro slide flow Screen rotation resets intro slides in splash screen demo May 30, 2016
@Sleeper9
Copy link
Author

Ah, I see, indeed. But I found another strange thing: the Get started button and the page indicator dots disappear in the "Start intro" demo if you rotate the device any slide other than the first and does not appear again until you go back to the first slide and rotate again.

@janheinrichmerker
Copy link
Owner

We should have another issue for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants