App.State.OnLeave is called first

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

App.State.OnLeave is called first

Post by Rado1 » Tue Jan 07, 2014 11:22 pm

When AppState is set from ZApplication.OnLoaded section, its OnLeave section is called before OnStart; it should not.

I also observed that after making some structural changes in a project, running the application (Alt+Enter) executes OnLeave section of the AppState which is not initially activated. This is really strange. However, this behavior seems to be non-deterministic and I cannot always reproduce it. It just sometimes happened.

To reproduce the bug, just run the attached project and watch the trace log -> "AppState1.OnLeave" appears before "AppState1.OnStart". (occasionally "AppState2.OnLeave" appears instead of "AppState1.OnLeave")
Attachments
test.zgeproj
testing project
(1.07 KiB) Downloaded 168 times

User avatar
VilleK
Site Admin
Posts: 1924
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Thu Jan 09, 2014 8:21 am

Hi,

I've now fixed this. Please download latest beta.

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Thu Jan 09, 2014 3:23 pm

Thanks Ville. BTW this version does not contain an updated Zge.java, so it cannot be used for ES2 Android live wallpapers, right? Do you plan to support building of live wallpapers directly from ZGE in (near) future?

User avatar
VilleK
Site Admin
Posts: 1924
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Fri Jan 10, 2014 11:40 am

I'm afraid I'm still too busy to add built-in Android wallpaper support. Also I suspect the number of users waiting for this feature is too small to warrant the work required (anyone think I'm wrong let me know!). For the time being the recommended way to build wallpapers is to use a standard ZGE Android project and then apply the changes from your wallpaper thread.

Post Reply