1. Are you ready for the Galaxy S20? Here is everything we know so far!

My app restarts when a new process is created

Discussion in 'Android Development' started by AnonTakesOver, Oct 23, 2014.

  1. AnonTakesOver

    AnonTakesOver Lurker
    Thread Starter

    So, I am making an app with a toggleable button, when the toggle is set to true, I need the phone to keep running in the background with the settings and code to run, that all works, except if I load a new process like listen to a song, or open a new app, then go back into my app, the button is disabled and the onCreate function is called.
     



    1. Download the Forums for Android™ app!


      Download

       
  2. deprogram

    deprogram Lurker

    You're going to have to post your code, onCreate() typically should only be called if you're doing something like finish(), although your activity lifecycle could end for other reasons.

    Impossible to know without code.
     
Loading...

Share This Page

Loading...