why onCallStateChanged() on Android is invoked more than one time in a single call？
<p>I wanted to implement a app that prevents calls like a firewall. When I debug my app, I found that when there is a call in, the <strong>onCallStateChanged()</strong> function in interface <strong>PhoneStateListener</strong> is invoked third times. In result, preventing one call can result in three logs. I'm so confused!!</p>

<p>my code:</p>

<pre><code>        @Override
        public void onCallStateChanged(int state, String incomingNumber) {
            // TODO Auto-generated method stub
            try {
                if (state == TelephonyManager.CALL_STATE_RINGING
                        &amp;&amp; PhoneUtil.getITelephony(tpm).isRinging()) {
                    String flag = isBlockCall(myContext, myHelper, myTypes,
                            incomingNumber);
                    if (flag.length() &gt; 0) {
                        blockCall();
                        myHelper.insertLog(new String[] { flag, incomingNumber,
                                String.valueOf(System.currentTimeMillis()),
                                null });
                        showNotification(myContext, incomingNumber,
                                System.currentTimeMillis());
                    }
                }
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            super.onCallStateChanged(state, incomingNumber);
        }
    }, PhoneStateListener.LISTEN_CALL_STATE);
</code></pre>
