See this example on how to keep your business running using the Bundle . First you must override the onSaveInstanceState method.
public void onSaveInstanceState(Bundle savedInstanceState) { TextView txtName = (TextView)findViewById(R.id.raj44); String aString = txtName.getText().toString(); savedInstanceState.putString("Name", aString); super.onSaveInstanceState(savedInstanceState); }
In the onCreate method , you can restore the state of your instance from a saved package.
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.concretetool); if (savedInstanceState != null) { String aString = savedInstanceState.getString("Name"); if (aString != null) { txtName = (TextView)findViewById(R.id.raj44); txtName.setText(aString); } } }
source share