I'm using an intent-filter to listen to changes in PHONE_STATE
<!-- Listen for phone status changes -->
<receiver android:name=".IncomingCallReciever">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>
... and can easily detect an incoming call
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)
... but how can I determine if it is line 1 or line 2 that is ringing?
My application needs to react ONLY when the user is currently on a phone call and another call is coming in.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…