Author Topic: Correctly killing an application  (Read 1962 times)

Offline lawless_c

  • int
  • **
  • Posts: 96
    • View Profile
Correctly killing an application
« 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Correctly killing an application
« Reply #1 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.

Offline lawless_c

  • int
  • **
  • Posts: 96
    • View Profile
Re: Correctly killing an application
« Reply #2 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.