title: BroadcastReceiver called but PhoneStateListener not called
body: <p>While debugging the code below, BroadcastReceiverCustom is being
  called but PhoneStateListenerCustom is not.</p>
  
  <p>For now I and doing required action in BroadcastReceiverCustom only,
  but maynot be best place to do it.
  Any suggestions why PhoneStateListener not being called??
  Already spent lot of time for possible reasons, no idea??
  Manifest file is all correct with correct permissions.
  I see no runtime exceptions.</p>
  
  <p>BroadcastReceiverCustom.java</p>
  
  <pre><code>public class BroadcastReceiverCustom extends BroadcastReceiver {
  
  private static final String TAG = "BroadcastReceiverCustom";
  
      @Override
      public void onReceive(Context context, Intent intent) {
  
          Log.v(TAG, "WE ARE INSIDE!!!!!!!!!!!");
  
          TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
          PhoneStateListenerCustom phoneStateListenerCustom = new PhoneStateListenerCustom();
          telephony.listen(phoneStateListenerCustom, PhoneStateListener.LISTEN_CALL_STATE);
      }
  }
  </code></pre>
  
  <p>PhoneStateListenerCustom.java</p>
  
  <pre><code>public class PhoneStateListenerCustom extends PhoneStateListener {
  
      private static final String TAG = "PhoneStateListenerCustom";
  
      public void onCallStateChange(int state, String incomingNumber){
  
          Log.v(TAG, "WE ARE INSIDE!!!!!!!!!!!");
          switch(state){
              case TelephonyManager.CALL_STATE_RINGING:
                   Log.d(TAG, "RINGING");
                   break;
          }
  
          super.onCallStateChanged(state, incomingNumber);
  
      }
  }
  </code></pre>
  
  <p>Manifest file</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  &lt;receiver android:name=".BroadcastReceiverCustom"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.PHONE_STATE" /&gt;
      &lt;/intent-filter&gt;
  &lt;/receiver&gt;
  </code></pre>