0

• I have two Activities, Activity A and Activity B.

• I load Activity B with a Activity A's fade exit transition.

• After Activity B is loaded, I rotate the device.

• When I hit the back button to go back to Activity A, my toolbar dissappears! My toolbar is a custom view, but I don't think that should affect it from showing up again.

This is my main_exit_transition.xml file, just one line:

<fade xmlns:android="http://schemas.android.com/apk/res/android"/>

In my styles.xml:

<style name="AppTheme.Main">
    <item name="android:windowExitTransition">@transition/main_exit_transition</item>
</style>

Some key behaviors:

• Everything will work fine if I don't rotate. It will also work fine if I remove transitions from my app.

• View will reappear after the onStop() method is executed (holding home button and going back to app)

• I can still interact with the view, e.g. I can still tap on the overflow menu. I just can't see it.

mco
  • 1,809
  • 15
  • 31

1 Answers1

0

My guess is that your implementation of the toolbar isn't consistent.

To explain a bit further, I suspect that your Activity A restarts and the toolbar isn't redrawn by default, as it is custom, since you didn't tell it to.

So I would look into how Activity A restarts. Does it go through the same code as it initially did? If not, how is the activity being created?

My experience with this kind of thing happening, especially with things disappearing, is that the objects aren't saved when your activity is destroyed or re-oriented.

TygerTy
  • 705
  • 6
  • 10