Created
          June 11, 2022 17:02 
        
      - 
      
- 
        Save molidev8/67be098e3f763a95a2f48a83a9d9c74f to your computer and use it in GitHub Desktop. 
    A ServiceConnection implementation
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | private lateinit var timerService: TimerService | |
| private var isTimerServiceBound: Boolean = false | |
| private val timerServiceConnection = object : ServiceConnection { | |
| override fun onServiceConnected(name: ComponentName?, binder: IBinder?) { | |
| timerService = (binder as TimerService.TimerBinder).service | |
| isTimerServiceBound = true | |
| } | |
| override fun onServiceDisconnected(p0: ComponentName?) { | |
| isTimerServiceBound = false | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment