title: How do I implement a BroadcastReceiver in a Service Class in Android?
body: <p>I need to implement BroadcastReceiver in a Service class I have created:</p>
  <pre class="lang-java prettyprint-override"><code>public class MyService extends Service
  </code></pre>
  <p>In this class I have to implement a simulation of download by using a Thread - Sleep when the user presses the button in the <code>MyActivity</code> class which implements <code>sendBroadcast()</code>. I cannot extend the Service class to <code>BroadcastReceiver</code> as it is already extends to <code>Service</code>. Can anyone help me to figure it out how to implement this mechanism?</p>