I just started programming and it’s impossible to save the parameters. I have 3 objects in which the user enters a price and then presses a button that transfers the parameters entered by the user to another activity and transfers it to him. So, I need these parameters to be saved to a file after clicking on the button, and when the application is restarted, they are read and loaded back.
public class Settings extends AppCompatActivity { private Button ReadyS; private EditText PriceVIP1,PricePremium,PriceStandart; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings); addListenerOnButton(); } public void addListenerOnButton() { ReadyS = (Button) findViewById(R.id.ReadyS); ReadyS.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { PriceVIP1 = (EditText) findViewById(R.id.PriceVIP); PricePremium = (EditText) findViewById(R.id.PricePremium); PriceStandart = (EditText) findViewById(R.id.PriceStandart); int PriceVIP = Integer.parseInt(PriceVIP1.getText().toString()); int PricePrem = Integer.parseInt(PricePremium.getText().toString()); int PriceStan = Integer.parseInt(PriceStandart.getText().toString()); Intent intent = new Intent(Settings.this, MainActivity.class); intent.putExtra("PriceVIP", PriceVIP); intent.putExtra("PricePrem", PricePrem); intent.putExtra("PriceStan", PriceStan); startActivity(intent); } } ); } }