title: What is use of ServiceConnection
body: <h2>I am trying to connect my LocalBinder from MyService.java class and it needed this code</h2>
  
  <pre><code>private ServiceConnection myConnection = new ServiceConnection() {
          @Override
          public void onServiceConnected(ComponentName name, IBinder service) {
  
              MyLocalBinder binder = (MyLocalBinder)service;
              myService=binder.getService();
              isBound = true;
  
          }
  
          @Override
          public void onServiceDisconnected(ComponentName name) {
                  isBound=false;
          }
      };
  -
  </code></pre>
  
  <hr>
  
  <p>can you tell me what this code actually means and what is ServiceConnection and its actual uses.</p>