Skip to content

Commit

Permalink
terminal: old but working initialization (fixes #2042) (#2044)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
xyb994 and dogi authored Jun 13, 2024
1 parent 5fbd405 commit bb0b66a
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ import io.treehouses.remote.utils.DialogUtils

open class BaseFragment : Fragment() {
var lastMessage = " "
lateinit var mChatService: BluetoothChatService
open lateinit var mChatService: BluetoothChatService
var mBluetoothAdapter: BluetoothAdapter? = null
lateinit var listener: HomeInteractListener
override fun onAttach(context: Context) {
super.onAttach(context)
listener = if (context is HomeInteractListener) context else throw RuntimeException("Implement interface first")
if (this::mChatService.isInitialized) {
mChatService = listener.getChatService()
}
mChatService = listener.getChatService()
mBluetoothAdapter = (context.getSystemService(Context.BLUETOOTH_SERVICE) as? BluetoothManager)?.adapter
}

Expand Down

0 comments on commit bb0b66a

Please sign in to comment.