[android-developers] How to unregister listener after application get closed

2010-04-28 Thread zohar lerman
Hi, I am writing an application that listens to phone calls and perform some tasks when phone call arrives. The Application contains one activity which includes 2 buttons ‘Start’ and ‘Stop’ (where starts register the listener and stops unregister it – see code below). The problem starts when the

Re: [android-developers] How to unregister listener after application get closed

2010-04-28 Thread Anurag Singh
Why dont you put your code in OnDestry. like OnDestroy() { telephonyManager.listen(phoneListener, PhoneStateListener.LISTEN_NONE); } - Anurag Singh On Wed, Apr 28, 2010 at 7:07 PM, zohar lerman lirazo...@gmail.com wrote: Hi, I am writing an application that listens to phone