Fix edit/preview when activity is destroyed.

Bug: 65505
Change-Id: If3cc97f9d27976c5d6f9439c207f85e90d69ca2a