Re: [android-developers] Prevent garbage collection for Broadcast receiver that are dynamically registered

2012-08-16 Thread Mark Murphy
On Thu, Aug 16, 2012 at 7:26 AM, frantz lohier wrote: > Thank you Mark - this was never very clear in any of the books I've bought > regarding Android programming or on Android website unfortunately. Books and documentation cannot possibly cover the infinite variations of applications and the way

Re: [android-developers] Prevent garbage collection for Broadcast receiver that are dynamically registered

2012-08-16 Thread frantz lohier
Thank you Mark - this was never very clear in any of the books I've bought regarding Android programming or on Android website unfortunately. My next question is as follows: I've listed a receiver in the manifest as suggested pointing to the following definition: public class TESTWAKEUP extends

Re: [android-developers] Prevent garbage collection for Broadcast receiver that are dynamically registered

2012-08-15 Thread Mark Murphy
On Wed, Aug 15, 2012 at 12:34 PM, frantz lohier wrote: > Question: is there a way to ensure that receiver are programmatically > registered at run-time are not deallocated when an app goes in background? IMHO, a better implementation would be to register the receiver in the manifest, then use Pac

[android-developers] Prevent garbage collection for Broadcast receiver that are dynamically registered

2012-08-15 Thread frantz lohier
Dear All, I've developed an app that registers a receiver in the onResume() constructor. This receiver need not to be deallocated as it processes intent even when my app is not running on the foreground. For that reason, the receiver is not deregistered by onPause(). Now, when the app goes in