package com.base.browserwhite.ui.activity.splash

import android.app.Activity
import android.content.Intent
import android.util.Log
import com.base.browserwhite.ui.activity.MainActivity

object StartUtils {

    private val TAG = "SplashJumpUtils"
    fun jumpNextPage(context: Activity) {

        var jumpType = context.intent.getIntExtra("actionId", 0)

        Log.e(TAG, "actionId: $jumpType")

        if (jumpType == 0) {
            val uri = context.intent.data
            val str = (uri?.getQueryParameter("type") ?: "0")
            jumpType = str.toIntOrNull() ?: 0
            if (jumpType != 0) {
            }
        }
        when (jumpType) {
//=================================主动广播=======================================

//================================被动广播=========================================

            else -> {
                val isHotLaunch = context.intent?.extras?.getBoolean("isHotLaunch", false) ?: false
                if (!isHotLaunch) {

                    context.startActivity(Intent(context, MainActivity::class.java))

                }
            }
        }
        context.finish()
    }
}