5
我使用意圖過濾器來聽的變化PHONE_STATE我怎樣才能確定是否有呼叫振鈴的「2號線」(如呼叫等待)
<!-- Listen for phone status changes -->
<receiver android:name=".IncomingCallReciever">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>
...並可以很容易地檢測來電
intent != null
&& intent.getAction().equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)
&& intent.hasExtra(TelephonyManager.EXTRA_STATE)
&& intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_RINGING)
......但我怎麼能確定是否是線1或線2振鈴?
我的應用程序需要做出反應,只有當用戶是目前一個電話,另一個電話呼入。