【问题标题】:PhoneSateIntentReceiver code example in androidandroid中的PhoneSateIntentReceiver代码示例
【发布时间】:2012-01-08 05:35:44
【问题描述】:

考虑以下代码sn-p:

public class MyBroadReceiver  extends PhoneSateIntentReceiver
{
    public void onReceive(Context context,Intent i ){

        if(i.action == Intent.CALL_ACTION){
           //some code here 
         }
     }
}

假设已经调用notifyPhoneCallState使MyBroadReceiver能够接收到关于电话的通话状态,在什么情况下会执行上面的代码?

如果您对此有一些看法,请提出建议。

【问题讨论】:

  • 这个问题来自UpWork“Android Programming Test”吗? :)

标签: android call broadcastreceiver


【解决方案1】:

在什么情况下会执行上面的代码

永远不会,因为 Android SDK 中没有 notifyPhoneCallState(),因此您的应用永远不会编译。

另外,没有PhoneSateIntentReceiver,甚至没有PhoneStateIntentReceiver,所以你的应用永远不会编译。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多