Hi All,
I was wondering if anyone had seen the same behavior or know what's wrong.
I am trying to register my PhoneStateListener to listen for ServiceState
changes using the TelephonyManager System Service and it is not being
called on the initial registration with the 'tm.listen(...,...)' as the
documentation states it would be.
* final PhoneStateListener phoneStateListener = new PhoneStateListener()
> {
> ** @Override
> ** public void onServiceStateChanged(ServiceState serviceState) {**
> ** Toast.makeText(getApplicationContext(), "STATE CHANGED
> CALLED",
> ** Toast.LENGTH_SHORT).show();**
> ** gServiceState = serviceState;
> ** serviceStateRetrieved = true;
> ** }**
> ** };*
> public String getNetworkResourceCellId() {
> * TelephonyManager tm = (TelephonyManager)
> getSystemService(TELEPHONY_SERVICE);*
> serviceStateRetrieved = false;
> * tm.listen(phoneStateListener,
> PhoneStateListener.LISTEN_SERVICE_STATE);*
> ...
> return "cell_id";
> }
am i doing something obviously wrong?
thanks,
--edmund
--
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