package com.xhly.manageapp.broadcastreceiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import com.xhly.corelib.utils.AppUtils

class XhlyBroadCastReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context?, intent: Intent?) {
        Log.i("收到广播", "这是finish广播")
        val getAppList1 = AppUtils.GetAppList(context)
        getAppList1?.forEach {
            if (it.packageName.equals("com.xhly.easystud")) {
                it.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                context?.startActivity(it.intent)
            }
        }
    }
}