1
我想掛斷從android的傳出電話,但我無法檢測到CALL_STATE_RINGING
。Xamarin android掛斷了傳出的呼叫?
這裏我的代碼示例:
[BroadcastReceiver()]
[IntentFilter(new[] { "android.intent.action.NEW_OUTGOING_CALL", "android.intent.action.PHONE_STATE", "android.intent.action.PHONE_STATE_CHANGED" })]
class CallListener : BroadcastReceiver
{
public CallListener()
{
}
public override void OnReceive(Context context, Intent intent)
{
if (state == TelephonyManager.ExtraStateRinging)
{
//some code here
}
}
}
你不錯過'[BroadcastReceiver]'屬性嗎? – Cheesebaron
@Cheesebaron不,我不會在項目中忽略該屬性。 – Atlantis
所以你打OnReceive,但你不確定如何獲得當前狀態,或者是什麼問題? – Cheesebaron