title: Android: Redirect outgoing calls
body: <p>I'm trying to <em>redirect outgoing calls to a different phone number</em> on an Android device. So, I use a BroadcastReceiver &quot;listening&quot; for the NEW_OUTGOING_CALL intent, on his onReceive() method I use the setResultData() method to change the phone number.</p>
  <p>Like this:</p>
  <pre><code>public void onReceive(Context arg0, Intent arg1) {
      
      setResultData(&quot;351978923221&quot;);
  
  }
  </code></pre>
  <p>In the emulator all goes well, but on my real device (a crappy ZTE X850 with Android 2.1 I believe) it doesn't if the calling Intent originates in an Activity which is part of the same application. After the dialing screen appears, the phone terminates the call.</p>
  <p>Any thoughts out there on why this happens?</p>
  <p><strong>Note:</strong> I know my question is basically the same as <a href="https://stackoverflow.com/questions/3493287/android-capture-new-outgoing-call">this one</a> but I chose to ask it again anyway to provide additional details about what goes wrong.</p>
  <hr />
  <p><strong>Manifest File</strong></p>
  <p>An excerpt...</p>
  <pre><code>    &lt;receiver android:name=&quot;.OutgoingCallDetection&quot; android:exported=&quot;true&quot;&gt;
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;android.intent.action.NEW_OUTGOING_CALL&quot;
                      android:priority=&quot;9999&quot; /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
  &lt;/application&gt;
  
  &lt;uses-permission android:name=&quot;android.permission.CALL_PHONE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.PROCESS_OUTGOING_CALLS&quot; /&gt;
  </code></pre>