When I navigate away from an activity with calculation results,for example to check the diagrams in the help activity and I select the back button in action bar,the calculation have been reset to null.
I know there must be some way of setting the state of the activity to pause
instead of having it stopped when I navigate away.
Does anyone know how I would achieve this in code? Is there a way to set the activity so that it doesn't destroy when the user leaves it? Also if I was to set this,would that calculation be fixed to that activity or would it refresh when I recalculate?
The code for the action bar back button is like this:
final Button actionBarHome = (Button)actionBarLayout.
findViewById(R.id.action_bar_title);
actionBarHome.setBackgroundResource(R.drawable.ic_action_back);
actionBarHome.setOnClickListener(this);
actionBarHome.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(intent2);
}
});