Skip to content

Instantly share code, notes, and snippets.

@makzimi
Last active November 2, 2022 21:05
Show Gist options
  • Save makzimi/f36288f67eaffda0d5e7fbd3eabf5cfe to your computer and use it in GitHub Desktop.
Save makzimi/f36288f67eaffda0d5e7fbd3eabf5cfe to your computer and use it in GitHub Desktop.
TransactionTooLargeException_article_ActivityThread.java
@Override
public void handleStopActivity(ActivityClientRecord r, int configChanges,
PendingTransactionActions pendingActions, boolean finalStateRequest, String reason) {
...
final StopInfo stopInfo = new StopInfo();
// This is where the logic of stopping activity begins
performStopActivityInner(r, stopInfo, true /* saveState */, finalStateRequest,
reason);
...
stopInfo.setActivity(r);
stopInfo.setState(r.state);
stopInfo.setPersistentState(r.persistentState);
// Here we save the collected data
pendingActions.setStopInfo(stopInfo);
mSomeActivitiesChanged = true;
}
private void performStopActivityInner(...) {
...
callActivityOnStop(r, saveState, reason);
}
private void callActivityOnStop(ActivityClientRecord r, boolean saveState, String reason) {
...
// call onSaveInstanceState depending on the API version (isPreP)
if (shouldSaveState && isPreP) {
callActivityOnSaveInstanceState(r);
}
...
r.activity.performStop(r.mPreserveWindow, reason);
...
if (shouldSaveState && !isPreP) {
callActivityOnSaveInstanceState(r);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment