title: Overwrite json file after exiting app and relaunching
body: <p>I'm trying to save a single int to a file in my Android project although i cant get my write function to work.</p>
  
  <p>My JSON file:</p>
  
  <pre><code>{
    "user":
   {
     "userid":"0"
   }
  }
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>public String getJsonFile() {
          String jsonLocation = "";
          try {
              InputStream is = getAssets().open("useriidd.json");
              int size = is.available();
              byte[] buffer = new byte[size];
              is.read(buffer);
              is.close();
              jsonLocation = new String(buffer, "UTF-8");
          } catch (IOException ex) {
              ex.printStackTrace();
          }
          return jsonLocation;
  }
  
  public void jsonRead(){
      try {
          JSONObject reader = new JSONObject(getJsonFile());
          JSONObject sys = reader.getJSONObject("user");
          userid = Integer.parseInt(sys.getString("userid"));
      }
      catch (final JSONException e) {
          Log.e("asdasd", e.getMessage());
      }
  }
  
  public void jsonWrite(){
      try {
          JSONObject writer = new JSONObject(getJsonFile());
          JSONObject sys = writer.getJSONObject("user");
          sys.put("userid", Integer.toString(userid));
          Log.d("asdasd", getJsonFile());
      }
      catch (final JSONException e) {
          Log.e("asdasd", e.getMessage());
      }
  }
  </code></pre>
  
  <p>I need the userid value to also be saved if i exit the app and relaunch it.</p>