title: How to prevent singleton form being destroyed?
body: <p>In my app I have singleton class which holds all data about user's current workout. The data is constantly updated as user progresses with his workout. The problem is that usually after several minutes android os terminates my singleton and all data is lost. How could I tell android os to not terminate my singleton or at least decrease the chance of it happening?</p>
  
  <pre><code>public class WorkoutManager{
      private static WorkoutManager instance;
  
      private WorkoutManager() {}
  
      private ArrayList&lt;Workout&gt; workouts = new ArrayList&lt;&gt;();
  
      public static WorkoutManager getInstance()
      {
          if (instance == null)
          {
              instance = new WorkoutManager();
          }
          return instance;
      }
  
      public ArrayList&lt;Workout&gt; getWorkouts(){
          return workouts;
      }
  
      public Workout getWorkout(int index){
          return workouts.get(index);
      }
  
      public void setWorkouts(ArrayList&lt;Workout&gt; workouts){
          this.workouts = workouts;
      }
  
      public void addWorkout(Workout workout){
          workouts.add(workout);
      }
  }
  </code></pre>