Extract string resources
This commit is contained in:
@@ -5,6 +5,7 @@ import android.app.Application
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.content.SharedPreferences
|
||||
import android.content.res.Configuration
|
||||
import android.os.Build
|
||||
import android.preference.PreferenceManager
|
||||
|
||||
@@ -16,10 +17,19 @@ class App : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
app = this
|
||||
updateNotificationChannels()
|
||||
}
|
||||
|
||||
override fun onConfigurationChanged(newConfig: Configuration?) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
updateNotificationChannels()
|
||||
}
|
||||
|
||||
private fun updateNotificationChannels() {
|
||||
if (Build.VERSION.SDK_INT >= 26) @TargetApi(26) {
|
||||
val nm = getSystemService(NotificationManager::class.java)
|
||||
nm.createNotificationChannel(NotificationChannel(RepeaterService.CHANNEL,
|
||||
"Repeater Service", NotificationManager.IMPORTANCE_LOW))
|
||||
getText(R.string.notification_channel_repeater), NotificationManager.IMPORTANCE_LOW))
|
||||
nm.deleteNotificationChannel("hotspot") // remove old service channel
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user