增加开机启动,食堂切换功能

This commit is contained in:
2025-08-22 09:18:33 +08:00
parent a6cef6155b
commit cde2dccd04
8 changed files with 105 additions and 20 deletions
@@ -2,9 +2,13 @@ package com.shuwei.dish.match.base
import android.app.Application
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.SharedPreferences
import com.shuwei.dish.match.R
import com.shuwei.dish.match.db.DatabaseProvider
import com.shuwei.dish.match.utils.BootReceiver
class BaseApp : Application() {
@@ -16,12 +20,15 @@ class BaseApp : Application() {
override fun onCreate() {
super.onCreate()
instance = this
val filter = IntentFilter(Intent.ACTION_BOOT_COMPLETED)
registerReceiver(BootReceiver(), filter)
}
companion object {
// const val canteenId = "1678234139391512577"
const val canteenId = "0"
var canteenId = "0"
@Volatile
private var sharedPref: SharedPreferences? = null