Native phone dialer ghost appears in recent apps after calling setResultData(null);

谁说我不能喝 提交于 2019-12-24 03:09:13

问题


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?

来源:https://stackoverflow.com/questions/18862457/native-phone-dialer-ghost-appears-in-recent-apps-after-calling-setresultdatanul

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!