Android Question Restore State and Save State

Discussion in 'Android Questions' started by Yvon Steinthal, Jun 5, 2018.

  1. Yvon Steinthal

    Yvon Steinthal Active Member Licensed User

    Hi all,

    I used to force a certain orientation in my app, but now the client wants the app to be able to switch from landscape to portrait and vice-versa.

    My Activity_Pause contains:

    Code:
    StateManager.SaveState(Activity,"Exam")
    and my Activity_Resume contains:

    Code:
    StateManager.RestoreState(Activity,"Exam",0)
    However i get a log stating this:

    "Error loading state.
    java.lang.ArrayIndexOutOfBoundsException:length=1;index=1"

    Help?

    Thx

    Y.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Based on the error there was only one view in the activity when you saved it. For StateManager to work properly the views must be in the exact same order while you save and restore.
     
    Yvon Steinthal likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice