How to save setting after we exit the app using onDestroy?
Example:
When the app start, it will start Main_Activity.class
Button button1;
public class Main_Activity extends Activity {
super.onCreate(savedInstanceState);
................
}
Added a button named "button1" and give an Action to open new activity when clicked
public void button1_newactivity (View v){
button1 = (Button) findViewById(R.id.button1);
button1.setOnClickListener (new View.OnClickListener() {
public void onClick(View arg0) {
Intent secondactivity=new Intent (getApplicationContext(), Second_Activity.class);
startActivity(secondactivity);
}
});
}
Added 2 Checkbox on Second_Activity.class, as a default when the app start checkbox1 is selected and checkbox2 is not selected. But, when checkbox2 selected and checbox1 automatically not selected, after pressed another button it will start Third_Activity.class.
My Question is how can we save this setting, so when we exit the app, then start the app again, It will automatically start Third_Activity.class not Main_Activity.class like the first one?
What should we write in this part
protected void onDestroy(){
....................
}