I was able to reproduce #397 by:
Enabling in Developer settings on the phone the setting "Don't Keep activities, Destroy every activity as soon as the user leaves it".
which I believe simulates the case that Android will kill an activity in the background due to memory pressure
To reproduce the issue:
Set the above developer setting.
Launch the demo-view app.
Goto Tabs
Send it to the backgound.
Bring it into foreground again.
While this solves particular case, there appears to be similar issues in other scenarios which this does not address,
I was able to reproduce #397 by: Enabling in Developer settings on the phone the setting "Don't Keep activities, Destroy every activity as soon as the user leaves it". which I believe simulates the case that Android will kill an activity in the background due to memory pressure
To reproduce the issue:
While this solves particular case, there appears to be similar issues in other scenarios which this does not address,
e.g. ( after this fix is applied)