Saving the selected tab and restoring it when the activity is resumed.