Use require* from support lib

This commit is contained in:
Mygod
2018-03-07 23:22:38 -08:00
parent 063bf49bdd
commit a139632d04
3 changed files with 20 additions and 15 deletions

View File

@@ -129,13 +129,13 @@ class TetheringFragment : Fragment(), ServiceConnection {
override fun onStart() {
super.onStart()
val context = context!!
val context = requireContext()
context.registerReceiver(receiver, intentFilter(ConnectivityManagerHelper.ACTION_TETHER_STATE_CHANGED))
context.bindService(Intent(context, TetheringService::class.java), this, Context.BIND_AUTO_CREATE)
}
override fun onStop() {
val context = context!!
val context = requireContext()
context.unbindService(this)
context.unregisterReceiver(receiver)
super.onStop()