Hi.
I'd like to log some telephonyManager and phoneState events as
onCellLocationChanged and onCallStateChanged.. during my activity.
Cause i need this for more than one activity,  i created an
broadcastReceiver that receives broadcasts, when something special in
my activities happen.

But my problem is that i can't define a telephonyManager in the
broadcastReceiver
like in an activity.
Why wont the following work in?

.............
TelephonyManager tmanager = (TelephonyManager)
                                      getSystemService
(Context.TELEPHONY_SERVICE);
tmanager.listen( new PhoneStateListener(){

        public void onCallStateChanged(int state, String incomingNumber) {
                super.onCallStateChanged(state, incomingNumber);
                callstate =  state;
       }

}, PhoneStateListener.LISTEN_CALL_STATE);
...........

Why is getSystemService(String) undefined for a broadcastReceiver?
Where is my fault?
Thanks for an answer.
Mak
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to