so what im trying to do is take the int "inc" and .putPutExtra("Inc",inc) it to my second class called "Settings" and then save it via "SharedPreferences" and then when the user pushes the button to go back to my main class it auto loads that into a int
heres the code i used to send it to the settings class from MainActivity
int inc = 0;
Intent GoToSettings = new Intent(getApplicationContext(), settings.class);
GoToSettings.putExtra("Inc", inc);
startActivity(GoToSettings)
heres the code that receves it
Intent intent = getIntent();
Inc = intent.getIntExtra("Inc", 10);
heres the code that saves "Inc"
SharedPreferences Saveinc=getSharedPreferences("IncSave", Context.MODE_PRIVATE);
SharedPreferences.Editor SaveIncE=Saveinc.edit();
SaveIncE.putInt("IncSave", Inc);
SaveIncE.commit();
heres the code that receves the int after its saved
int inc = 1;
Intent GoToMain = getIntent();
inc = GoToMain.getIntExtra("IncSave", 1);
SharedPreferences GetSavedinc=getSharedPreferences("IncSave", Context.MODE_PRIVATE);
int IncSave=GetSavedUpCount.getInt("IncSave", 1);
inc=IncSave;
i no its not the prittyest layout but im new and havent really learned the syntex perfictly. im also new to the website to so if i dissobay a rule im sorry.