handle activity visibility