Native phone dialer ghost appears in recent apps a

2019-07-15 20:23发布

问题:

Whenever I try to use my own app to handle an Outgoing call, I see a zombie/ghost/second native phone dialer appear in the recent apps. This seems tied to calling setResultData(null) in my receiver.

Nexus 4 (Android 4.3)

I've add the correct permissions

<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />

And registered my receiver as follows

<receiver android:name=".OutGoingCallReceiver"> 
  <intent-filter> 
    <action android:name="android.intent.action.NEW_OUTGOING_CALL" /> 
  </intent-filter> 
</receiver>

and create:

public class OutGoingCallReceiver extends BroadcastReceiver{

    @Override
    public void onReceive(Context context, Intent intent) {

        // Cancel the broadcast and prevent other receivers from picking it up
        setResultData(null);

        // Do awesome call handling here
        //...
        }
}

Any ideas what is wrong?