Fix NP when activity detaches from fragment

Change-Id: I9cffdd137683b5a9fa45e21a22e859919a23cd8a