null check on windowActivity and its contents?  Maybe we can factor this into a convenience methods since it's used a bunch?