Run UI actions only when the activity is added to the fragment.
This is different from the previous behavior where we only check if it is not detached.
Checking for isAdded()
seems to include a check if the fragment currently has an activity associated.
Might fix #1336 (closed)