增加开机启动,食堂切换功能
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user