Limit the number of messages sent to One?
<p>I am working on application that requires to send a message to a caller. I am able to get to the phone number by PhoneStateListener. but when i send the message to the number retrieved, it sends the same message multiple times, say 2-3 time sometimes even 6-7 times. Why is it so? Any ideas.? Can i limit the number of messages sent to one..? So that only one message is sent at one time. My code is:</p>

<pre><code>@Override
public void onCallStateChanged(int state, String incomingNumber) {

    Log.e("Now", "onCallStateChanged");
    super.onCallStateChanged(state, incomingNumber);


    switch (state) {


    case TelephonyManager.CALL_STATE_IDLE:

        SmsManager sm = SmsManager.getDefault();
        // HERE IS WHERE THE DESTINATION OF THE TEXT SHOULD GO
        sm.sendTextMessage(incomingNumber, null, "message", null, null);
        break;
      }
</code></pre>

<p>}</p>

<p>Any help is appreciated...Thanks in advance..!!!!</p>
