Add settings

This commit is contained in:
Mygod
2018-01-03 22:58:45 +08:00
parent 3e7fae95cf
commit 826f601301
17 changed files with 313 additions and 75 deletions

View File

@@ -4,12 +4,20 @@ import android.app.Application
import android.app.NotificationChannel
import android.app.NotificationManager
import android.os.Build
import android.preference.PreferenceManager
class App : Application() {
companion object {
lateinit var app: App
}
override fun onCreate() {
super.onCreate()
app = this
if (Build.VERSION.SDK_INT >= 26) getSystemService(NotificationManager::class.java)
.createNotificationChannel(NotificationChannel(HotspotService.CHANNEL,
"Hotspot Service", NotificationManager.IMPORTANCE_LOW))
}
val pref by lazy { PreferenceManager.getDefaultSharedPreferences(this) }
}