Skip to content

Commit

Permalink
Fix call order of postCreate() and start() in LocalActivityInvoker. See
Browse files Browse the repository at this point in the history
  • Loading branch information
Googler authored and copybara-robolectric committed Mar 4, 2019
1 parent e64f675 commit d64534c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -39,6 +39,12 @@ public void onStart() {
callbacks.add("onStart");
}

@Override
public void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
callbacks.add("onPostCreate");
}

@Override
public void onResume() {
super.onResume();
Expand Down Expand Up @@ -95,7 +101,8 @@ public void launch_callbackSequence() {
ActivityScenario.launch(TranscriptActivity.class);
assertThat(activityScenario).isNotNull();
assertThat(callbacks)
.containsExactly("onCreate", "onStart", "onResume", "onWindowFocusChanged true");
.containsExactly(
"onCreate", "onStart", "onPostCreate", "onResume", "onWindowFocusChanged true");
}

@Test
Expand Down
Expand Up @@ -40,8 +40,8 @@ public void startActivity(Intent intent) {
controller =
Robolectric.buildActivity(activityClass, intent)
.create()
.postCreate(null)
.start()
.postCreate(null)
.resume()
.postResume()
.visible()
Expand Down

0 comments on commit d64534c

Please sign in to comment.