Mapped activity start/stop events to gained/lost focus events