package com.quyunshuo.module.home.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.quyunshuo.module.home.activity.main.MainActivity


class BootCompleteReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        // an Intent broadcast.
        if (Intent.ACTION_BOOT_COMPLETED == intent.action) {
            val thisIntent = Intent(context, MainActivity::class.java)
            thisIntent.setAction("android.intent.action.MAIN")
            thisIntent.addCategory("android.intent.category.LAUNCHER")
            thisIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context.startActivity(thisIntent)
        }
    }
}
