title: how to save game state/preferences in android using libgdx
body: <p>I am trying to save the values of various variables which my game is progressing, like logo number or lives available, etc using <strong>LIBGDX</strong> framework.</p>
  
  <p>Code goes as such:</p>
  
  <pre><code>static Preferences prefs = Gdx.app.getPreferences("My_state");
  public static void ContinuePutstate() {
      prefs.putInteger("option", MenuScreen.option);
      prefs.putInteger("lifes", Loadassets.lifes);
      prefs.putInteger("hammertouch", Loadassets.hammertouch);
      prefs.putInteger("multilogonum", Loadmultiple.multilogonum);
      prefs.putInteger("brushtouch", Loadassets.brushtouch);
      prefs.putInteger("leveluser", Loadassets.Leveluser);
      prefs.putInteger("iconnumber", CorrectScreen.iconnumber);
  
      System.out.println("HAd saved option "+prefs.getInteger("option")+" and original option is "+MenuScreen.option);
  }
  </code></pre>
  
  <p>When I tried to print that, I am getting option 0 but <code>menuscreen</code> option actually has another value.</p>