• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

[solved] SaveState() crashes App

Holzchopf

Well-known member
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
500
When I use SaveState() my App crashes. After a while, the message "APPNAMEHERE isn't responding. Do you want to close it? <Wait> <OK>" appears.

Fun thing is: the state is saved correctly anyway. And can be loaded without any trouble.

Does anyone know what could cause this? Or how to debug such a case?

Thank you
 
Anthing in android logs?
 
And how do you know it is savestate that crashes the app?
 
Ha! I look old now :oops:

I really thought I had tracked it down to SaveState(). I have something like this:
Code:
        If health < 0 Then
            endtime = ctime + 3000
            If score > highscore Then
                highscore = score
                SaveState(highscore)
            End
            newstate = STATE_END
        End

And since I only remembered it to crash when the highscore was cracked, I concluded it had to be either "highscore = score" or SaveState(highscore). Of course the fact that the score could be loaded later with LoadState() made me curious - but not enough...
Aaaand: Just a minute ago or so it even crashed without a new highscore. The problem is clearly somewhere else.

I'll look into some other bits of code and come back to you later.

Oh and btw: Where would I find those
android logs
?
 
Found it!

Believe it or not:
There's an animation in the main menu. When leaving the menu and starting to actually play, that animation was not correctly reset - meaning I only reset the timer but not it's state (it has states like idle, blend in, be there, blend out)... Now, when starting to play in the exact right moment, this mishap could crash the animation when it came back in later (at the end of the game).

Why this only happened on Android but never on HTML5? Pure coincidence.
Why this only happened when cracking the highscore until this morning? Pure coincidence.

And because of that I opened this thread :rolleyes: But in my defence, as an Android newbie I expected something like
Oh, did you think about granting permission android.permission.DO_NOT_CRASH_AFTER_SAVING_STATE ?

Conclusion: Neither an Android nor a SaveState() related problem.
 
Back
Top Bottom