public class Settings extends AppCompatActivity {
SharedPreferences sf;
EditText money;
public static final String preference = "pref";
public static final String saveIt = "saveKey";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
money = (EditText) findViewById(R.id.text_input_money);
sf = getSharedPreferences(preference, Context.MODE_PRIVATE);
}
public void save(View view) {
String store = money.getText().toString();
SharedPreferences.Editor editor = sf.edit();
editor.putString(saveIt, store);
editor.commit();
}
}