title: Android Call Waiting State
body: <p>Is there any state which can tell us that the line is connected and other person's phone is ringing. Like I want to know the state where proper connection is made and other person knows you are calling and can answer it?</p>
  
  <p>I have tried this but it never goes in phone ringing state:</p>
  
  <pre><code>public void onReceive(final Context context, Intent intent) {
  TelephonyManagerTm=(TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
          Tm.listen(new PhoneStateListener(){
              public void  onCallStateChanged(int state,String number) {
                  super.onDataConnectionStateChanged(state);
                  switch(state)
                  {
                      case TelephonyManager.CALL_STATE_RINGING:
                          Toast.makeText(context, "Phone Ringing", 1).show();
                          break;
                      case TelephonyManager.CALL_STATE_OFFHOOK:
  
                          break;
                      case TelephonyManager.CALL_STATE_IDLE: 
                          Toast.makeText(context, "call rejected", 1).show();                 
                          break;
                  }
              }
          },PhoneStateListener.LISTEN_CALL_STATE);
  </code></pre>