Not able to get the TelephonyManager.CALL_STATE_RINGING
<p>I added this is my manifest file - </p>

<pre><code>        &lt;receiver android:name=".ServiceReceiver"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.PHONE_STATE" /&gt;
        &lt;/intent-filter&gt;
    &lt;/receiver&gt;
&lt;/application&gt;

&lt;uses-permission android:name="android.permission.READ_PHONE_STATE"&gt;
&lt;/uses-permission&gt;
</code></pre>

<p>Then my service class is like this - </p>

<pre><code>public class ServiceReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
    MyPhoneStateListener phoneListener = new MyPhoneStateListener();
    TelephonyManager telephony = (TelephonyManager) context
            .getSystemService(Context.TELEPHONY_SERVICE);
    telephony.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE);
}
</code></pre>

<p>}</p>

<p>and my PhoneStateListener is - </p>

<pre><code>public class MyPhoneStateListener extends PhoneStateListener {

public void onCallStateChanged(int state, String incomingNumber) {
    Log.i("telephony-example", "State changed: " + stateName(state));
}

String stateName(int state) {
    switch (state) {
    case TelephonyManager.CALL_STATE_IDLE:
        Log.d("DEBUG", "***********IDLE********");
        return "Idle";
    case TelephonyManager.CALL_STATE_OFFHOOK:
        Log.d("DEBUG", "***********OFFHOOK********");
        return "Off hook";
    case TelephonyManager.CALL_STATE_RINGING:
        Log.d("DEBUG", "***********RINGING********");
        return "Ringing";
    }
    return Integer.toString(state);
}
</code></pre>

<p>}</p>

<p>I am able to see the IDLE State.</p>

<p>But When I call i dont get the Ringing state. Why?</p>
