Dinesh Sharma Dinesh Sharma - 4 months ago 23
Android Question

PhoneSateIntentReceiver code example in android

Considering the following code snippet :

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

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


Assuming that
notifyPhoneCallState
has been called to enable
MyBroadReceiver
to receive about the phone call state, in which cases the above code will be executed?

Please suggest if you have some views over this.

Answer

in which cases the above code will be executed

Never, since there is no notifyPhoneCallState() in the Android SDK, and so your app will never compile.

Also, there is no PhoneSateIntentReceiver, or even a PhoneStateIntentReceiver, and so your app will never compile.

Comments