title: PhoneStateListener not working on Samsung GT-S7562
body: <p>I am testing PhoneStateListener on Samsung GT-S7562(dual sim- 4.0) then STATE always returns 0 and INCOMING NUMBER always returns empty. While it works fine on my another device SAMSUNG GT-S5570(single sim- 2.2). Here is my code.</p>
  
  <pre><code>import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.telephony.PhoneStateListener;
  import android.telephony.TelephonyManager;
  import android.util.Log;
  import android.widget.Toast;
  
  public class IncomingCall extends BroadcastReceiver {
      Context pcontext;
  
      public void onReceive(Context context, Intent intent) {
          pcontext = context;
  
          try {
              TelephonyManager tmgr = (TelephonyManager) context
                      .getSystemService(Context.TELEPHONY_SERVICE);
  
              MyPhoneStateListener PhoneListener = new MyPhoneStateListener();
  
              tmgr.listen(PhoneListener, PhoneStateListener.LISTEN_CALL_STATE);
  
          } catch (Exception e) {
              Log.e("Phone Receive Error", " " + e);
          }
  
      }
  
      private class MyPhoneStateListener extends PhoneStateListener {
          public void onCallStateChanged(int state, String incomingNumber) {
              switch (state) {
              case TelephonyManager.CALL_STATE_IDLE:
                  Toast.makeText(
                          pcontext,
                          "CALL_STATE_IDLE.\nIncomming Number : "
                                  + incomingNumber, Toast.LENGTH_SHORT).show();
                  break;
              case TelephonyManager.CALL_STATE_OFFHOOK:
                  Toast.makeText(
                          pcontext,
                          "CALL_STATE_OFFHOOK.\nIncomming Number : "
                                  + incomingNumber, Toast.LENGTH_SHORT).show();
                  break;
              case TelephonyManager.CALL_STATE_RINGING:
                  Toast.makeText(
                          pcontext,
                          "CALL_STATE_RINGING.\nIncomming Number : "
                                  + incomingNumber, Toast.LENGTH_SHORT).show();
                  break;
              default: {
                  Toast.makeText(pcontext,
                          "Default.\nIncomming Number : " + incomingNumber,
                          Toast.LENGTH_SHORT).show();
              }
              }
          }
      }
  }
  </code></pre>
  
  <p>Also added Persmission in menifest file.</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  
  &lt;receiver android:name="com.example.caller.ServiceReceiver" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.PHONE_STATE" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  </code></pre>