hi, have the following code :

public class OnCallReceiver extends BroadcastReceiver{
        @Override
        public void onReceive(Context context, Intent intent) {
                Log.i(this.getClass().getSimpleName(), " on Receive called ");
                TelephonyManager tm =
(TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
                Log.i(this.getClass().getSimpleName(), " starts listening ");
                tm.listen(new OnCallPhoneStateListener(context),
PhoneStateListener.LISTEN_CALL_STATE);
        }
}
public final class OnCallPhoneStateListener extends PhoneStateListener
{ ....}

It functionally works. OnCallPhoneStateListener gets called correctly,
shows some info with a Toast.
However, i think a new instance gets created and starts to listen
every time onReceive is called.
Because after a few onReceive I am starting to see many Toasts
floating around :)

Can some one please enlighten me is this intended or am i doing
something wrong?
thanks

-- 
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