Stop using LocalBroadcastManager

This commit is contained in:
Mygod
2018-05-09 15:56:37 -07:00
parent 1695295eb3
commit e72dad8790
8 changed files with 83 additions and 62 deletions

View File

@@ -12,10 +12,10 @@ import android.os.Handler
import android.preference.PreferenceManager
import android.support.annotation.StringRes
import android.widget.Toast
import be.mygod.vpnhotspot.util.Event0
class App : Application() {
companion object {
const val ACTION_CLEAN_ROUTINGS = "be.mygod.vpnhotspot.CLEAN_ROUTINGS"
const val KEY_OPERATING_CHANNEL = "service.repeater.oc"
private const val KEY_DNS = "service.dns"
@@ -54,5 +54,7 @@ class App : Application() {
get() = pref.getString(KEY_DNS, "8.8.8.8")
set(value) = pref.edit().putString(KEY_DNS, value).apply()
val cleanRoutings = Event0()
fun toast(@StringRes resId: Int) = handler.post { Toast.makeText(this, resId, Toast.LENGTH_SHORT).show() }
}