Files
my-tv/app/src/main/java/com/lizongying/mytv/BootReceiver.kt
T
2024-03-07 19:37:03 +08:00

18 lines
455 B
Kotlin

package com.lizongying.mytv
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
class BootReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (SP.bootStartup) {
context.startActivity(
Intent(context, MainActivity::class.java)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
)
}
}
}