@@ -751,6+751,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
}
}
} else { // The app has been restarted.
}
}
} else { // The app has been restarted.
+ // Set the saved tab position to be the size of the saved state array list. The tab position is 0 based, meaning the at the new tab will be the tab position that is restored.
+ savedTabPosition = savedStateArrayList.size();
+
// Replace the intent that started the app with this one. This will load the tab after the others have been restored.
setIntent(intent);
}
// Replace the intent that started the app with this one. This will load the tab after the others have been restored.
setIntent(intent);
}
@@ -4356,7+4359,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
// Add the first tab.
addNewTab("", true);
} else { // The activity has been restarted.
// Add the first tab.
addNewTab("", true);
} else { // The activity has been restarted.
- // Restore each tab. Once the minimum API >= 24, a `forEach()` command can be used.
+ // Restore each tab.
for (int i = 0; i < savedStateArrayList.size(); i++) {
// Add a new tab.
tabLayout.addTab(tabLayout.newTab());
for (int i = 0; i < savedStateArrayList.size(); i++) {
// Add a new tab.
tabLayout.addTab(tabLayout.newTab());
@@ -5330,9+5333,11 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook