title: How to know whether my Android BroadcastReceiver is registered or not
body: <p>I am using an BroadcastReceiver for action related to sd card events like mount / unmount.</p>
  
  <p>Now the situation is my receiver is not working. My application only have an BroadcastReceiver no GUI, no Activity, no layout. So now I want to debug the code so I want a message to be printed when I am installing the application. So I am looking for an method like an <code>onCreate()</code> which Service and Activity have. I have read the official document of BroadcastReceiver here</p>
  
  <p><a href="http://developer.android.com/reference/android/content/BroadcastReceiver.html" rel="nofollow">http://developer.android.com/reference/android/content/BroadcastReceiver.html</a></p>
  
  <p>I was unable to find a method like that. So how can I know whether my android BroadcastReceiver is registered or not. Which method I have to use for getting the info whether my android BroadcastReceiver is registered or not. Is there any other way I can get the infothat mu receiver is registered and in tents are not working.</p>
  
  <p>Here is my <strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.broadcastreceiversdcardinsertionremoval"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="17" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;receiver
              android:name="SDCardStateChangeListener"
              android:enabled="true"
              android:exported="false" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MEDIA_UNMOUNTED" /&gt;
                  &lt;action android:name="android.intent.action.MEDIA_REMOVED" /&gt;
                  &lt;action android:name="android.intent.action.MEDIA_EJECT" /&gt;
                  &lt;action android:name="android.intent.action.MEDIA_BAD_REMOVAL" /&gt;
  
                  &lt;data android:scheme="file" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>and my  SDCardStateChangeListener.java which extends BroadcastReceiver</strong></p>
  
  <pre><code>package com.example.broadcastreceiversdcardinsertionremoval;
  
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.util.Log;
  
  public class SDCardStateChangeListener extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
          String action = intent.getAction();
          if (action.equalsIgnoreCase(Intent.ACTION_MEDIA_REMOVED)
                  || action.equalsIgnoreCase(Intent.ACTION_MEDIA_UNMOUNTED)
                  || action.equalsIgnoreCase(Intent.ACTION_MEDIA_BAD_REMOVAL)
                  || action.equalsIgnoreCase(Intent.ACTION_MEDIA_EJECT)) {
  
              Log.d("action", "Sd Card Event");
  
          }
      }
  
  }
  </code></pre>