Correctly killing an application

Started by lawless_c, October 05, 2016, 01:23:48 PM

Previous topic - Next topic

lawless_c

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.

EgonOlsen

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.

lawless_c

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.