www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: lawless_c on October 05, 2016, 01:23:48 pm

Title: Correctly killing an application
Post by: lawless_c on October 05, 2016, 01:23:48 pm
Is there anything JPCT specific that needs to be done when closing/killing an application.

I'm trying out doing a livewallpaper but i'm finding if the wallpaper activity has already been launched once for example in preview mode then the next time i try to launch preview mode or set it as a wallpaper the application seems to hang and i'm left with just a black background.

However if i reset my phone the wallpaper will then switch on correctly.
Title: Re: Correctly killing an application
Post by: EgonOlsen on October 06, 2016, 11:00:34 am
For a normal app, no. For a wallpaper... No idea. Nothing jPCT specific, I would say. What would end any wallpaper should kill a jPCT using one.
Title: Re: Correctly killing an application
Post by: lawless_c on October 08, 2016, 01:29:09 am
I found the issue: when i load the wallpaper in preview mode it creates an instance.


If i click "Set Wallpaper" android will try to carry to over the instance to the actual background , which is where it appears as just a black empty space and hangs.

what is do is in the onDestroy() method calll System.exit(0)  , which forces a new instance to be loaded.

It works for now , but i worry it is probably a hack.