2010-02-19 97 views

回答

11

奇怪的是,Phone application处理呼叫相关的事件。 ;)

您可以在logcat中观看ActivityManager输出,以查看哪个组件处理特定的Intent

在联系人源代码:

Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED, 
    Uri.fromParts("tel", number, null)); 
startActivity(intent); 

可以在命令行上重现此Intent
adb -e shell am start -a android.intent.action.CALL_PRIVILEGED -d tel:12345

这导致下述(很好格式)logcat的输出:

 
Starting activity: Intent { 
    act=android.intent.action.CALL_PRIVILEGED 
    dat=tel:12345 
    flg=0x10000000 
    cmp=com.android.phone/.PrivilegedOutgoingCallBroadcaster 
}

这说明你应用程序的这个com.android.phone dles这个特别的Intent

+0

呵呵不错!看起来我之后叫做OutgoingCallBroadcaster。 :) – mobilekid 2010-02-19 15:10:11

+0

很好的答案,谢谢! – mobilekid 2010-02-19 17:38:04

+1

你能告诉我你在哪个SDK版本中找到Intent.ACTION_CALL_PRIVILEGED?我找不到它,即使语法不显示它。只能看到Intent.ACTION_CALL(sdk 2.1)。谢谢 – 2010-08-11 09:57:57