package com.gh.gamecenter.common.tracker

import android.app.Activity
import android.app.Application
import android.os.Bundle

// FYI 快速启动并且不设置 contentView 马上结束的 SplashActivity 没有 onStart 和 onStop 回调
class ActivityLifecycleWatcher(private val mTrack: ITrack) : Application.ActivityLifecycleCallbacks {

    override fun onActivityStarted(activity: Activity) {
        mTrack.onActivityStarted(activity)
    }

    override fun onActivityStopped(activity: Activity) {
        mTrack.onActivityStopped(activity)
    }

    override fun onActivityDestroyed(activity: Activity) {}
    override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
    override fun onActivityPaused(activity: Activity) {}
    override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {}
    override fun onActivityResumed(activity: Activity) {}

}