When storing data in android studio using SharedPreferences. it store did not store the Newest value at first. I mean the data location does not update. I want to newest store data in 1st location and the previously stored data automatics shift to the next location. Example> I enter/store first time a value in Edit Text. it stores in the first location but when I store the Second value. It did not update the first value location it store data in the second location.
btnSaved.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt("id", item.getId());
editor.putString("name", item.getName());
editor.putString("image", item.getImge());
editor.putString("status", item.getStatus());
editor.putString("timeStamp", item.getTimeStamp());
editor.putString("URL", item.getUrl());
editor.commit();