private class MyPhoneStateListener extends PhoneStateListener
{
public void onCallStateChanged(int state, String incomingNumber)
{
log("listener call state: " + phoneStateToString(state) + " "
+ new Date());
}
}
MyPhoneStateListener myPhoneStateListener = new MyPhoneStateListener
();
/*
* telMgr.listen(myPhoneStateListener,
TelephonyManager.CALL_STATE_IDLE
* | TelephonyManager.CALL_STATE_RINGING |
* TelephonyManager.CALL_STATE_OFFHOOK);
*/
// let's try this...
telMgr.listen(myPhoneStateListener,
TelephonyManager.CALL_STATE_IDLE);
telMgr.listen(myPhoneStateListener,
TelephonyManager.CALL_STATE_RINGING);
telMgr.listen(myPhoneStateListener,
TelephonyManager.CALL_STATE_OFFHOOK);
Intent myIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:
1234567"));
thisActivity.startActivity(myIntent);
I can see the call definitely get placed on the emulator - however, no
PhoneStateListener callback.
I can always resort to polling with
telMgr.getCallState()
but it's not as elegant as a callback - anyway, wondering what's up.
-dreamer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---