Yvon Steinthal Active Member Licensed User Jun 5, 2018 #1 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: B4X: StateManager.SaveState(Activity,"Exam") and my Activity_Resume contains: B4X: 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.
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: B4X: StateManager.SaveState(Activity,"Exam") and my Activity_Resume contains: B4X: 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.
Erel B4X founder Staff member Licensed User Longtime User Jun 5, 2018 #2 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. Upvote 0
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.