Android capture new outgoing call
<p>The requirement is to replace newly dialed number with another one. I have captured the ACTION_NEW_OUTGOING_CALL event and used Intent.EXTRA_PHONE_NUMBER to get the current outgoing number and then I have used setResultData inside my class(which extends BroadcastReceiver) to replace the dialed number. Basically code is,</p>

<pre><code>if (Intent.ACTION_NEW_OUTGOING_CALL.equals(action)) {

   String phonenbr = 
    intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
   Log.d("OutGoingNum", "phonenbr is " + phonenbr);

   if (phonenbr.startsWith("00")) {
    setResultData("12345678");
   } 
  }
</code></pre>

<p>My code works fine in Android emulator but on the device the code works only on Redial. It doesnt work when you dial the number via dialpad. Please help. </p>
