Try this it might help you.
Paste this code second activity. This method is called when screen orientation change.
For ex: portrait to landscape or vice versa.
Take one variable and manipulate that variable value to know on previous activity.
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
//Write Logic for start the same activity like and restore the data.
startActivity(new Intent(context,SecondActivity.class));
}