title: IntentService OnHandleIntent is not being called
body: <p>I am trying to run a background music using Intent service. The OnhandleIntent does not get called. I tried adding breakpoints and even the code  android.os.Debug.waitForDebugger(); but i am unable to step into OnHandleIntent.
  I have added the service to the manifest( android:name=&quot;.BackgroundMusic&quot;/&gt;) and i am not sure what i am missing here. Any help would be appreciated.</p>
  <pre><code>public class BackgroundMusic extends IntentService
   {
     MediaPlayer mp;
     Uri uri;
  
  public BackgroundMusic()
  {
      super(&quot;BackgroundMusic&quot;);
       setIntentRedelivery(true);
  }
  
  @Override
  protected void onHandleIntent(Intent intent)
  {   
      try     
      {   
           android.os.Debug.waitForDebugger();
          int id=intent.getExtras().getInt(&quot;musicid&quot;);            
          mp=MediaPlayer.create(this,id);
          mp.prepare();
          mp.start();     
      }   
      catch (Exception e)
      {
          Log.e(&quot;Error&quot;,e.getMessage());
      }       
  }
  
  @Override
  public void onCreate()
  {
      super.onCreate();
  }
  
  @Override
  public void onDestroy() 
  {
      super.onDestroy();
      if (mp != null) 
          mp.release();
          mp=null;
  }
  </code></pre>
  <p>}</p>
  <h2>Activity Code</h2>
  <pre><code>    @Override
  public void onCreate(Bundle savedInstanceState)
  {
      try
      {
              super.onCreate(savedInstanceState);
               LMain=new LinearLayout(this);  
                       LMain.setOrientation(LinearLayout.HORIZONTAL);
             LayoutParams pFill=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
                LMain.setLayoutParams(pFill);
              imageview=new ImageView(this);          
                              imageview.setLayoutParams(pFill);
              setContentView(LMain);
                  
              Intent IntImage=getIntent();
              int id=IntImage.getExtras().getInt(&quot;id&quot;);
                  mresourceid=new ImageAdapter(this).music[id];       
              imageview.setImageResource(new ImageAdapter(this).images[id]);
              Intent IntMusic=new Intent(ImageDetail.this,BackgroundMusic.class);
              IntMusic.putExtra(&quot;musicid&quot;, mresourceid);
              startService(IntMusic);     
      }
      catch(Exception e)
      {
          Log.e(&quot;error&quot;,e.getMessage());
      }
      
  }
  </code></pre>