package com.dlc.chemical.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.dlc.chemical.BuildConfig

/**
 * info
 *
 * @author ReiChin_
 */
class OpenApkReceiver : BroadcastReceiver() {

    override fun onReceive(context: Context?, intent: Intent?) {
        val localIntent: Intent
        if (intent!!.action.equals("android.intent.action.PACKAGE_REPLACED")) {
            localIntent = Intent()
            localIntent.setClassName(BuildConfig.APPLICATION_ID, "com.dlc.chemical.ui.SplashActivity")
            localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context!!.startActivity(localIntent)
        }
    }

}