simplify API and resolve unhelpfully deallocated activity

There seemed to be a race condition if the activity was ended during shutdown where the mActivity pointer referenced a deallocated object, the global fixes that.