title: How or why do listener interfaces work? And do interfaces have any other use rather than being a listener?
body: <p>Whenever we want to create a listener, we implement a listener interface. For example, lets implement <code>SensorEventListener</code>. </p>
  
  <p>Now we have to override the methods of this listener interface. </p>
  
  <p><code>public void onSensorChanged(SensorEvent event);</code> </p>
  
  <p>and </p>
  
  <p><code>public void onAccuracyChanged(Sensor sensor, int accuracy);</code></p>
  
  <p><strong>What I don't understand is:</strong></p>
  
  <ol>
  <li>Why and how these methods work when I automatically use them? </li>
  <li>Why does <code>onAccuracyChanged</code> method gets called when the accuracy changes?</li>
  <li>After all, <code>onAccuracyChanged</code> is just an empty method that we override because our formula (or the interface we implement) requires us to do so. If it is something magical caused by the lower levels</li>
  <li>When and why would someone actually use an interface in his/her
  self-project regardless of android?</li>
  </ol>