The onCreate of an Application (subclass) is called exactly *once *for each 
instance of a DalvikVM. 

If Android kills your app's process, it stops the DalvikVM instance as 
well. There is no way to 'hold on' to any reference, since you DalvikVM 
instance that was running your app no longer exists.

Your app can, however, use more than one process. I don't know if the ACRA 
code runs in its own process and not liking being used by two or more 
processes running the same package (your app).  

More info is needed to figure this one out.


On Saturday, November 10, 2012 4:32:42 PM UTC-5, Craig wrote:
>
> I received an error because I'm doing something (init'ing ACRA) in my 
> overridden Application class' onCreate, and I expected this method to be 
> called only once. I think I have a clue as to what is happening - I see 
> multiple logcat lines like: "Force stopping package ...." for my package 
> close together, for example:
> 11-09 11:53:40.394
> 11-09 11:53:40.744
> 11-09 11:53:41.364
>
> I am using a Service, but only through onHandleIntent, and I did not 
> register it to run in a separate process. 
>
> My theory is that I'm holding onto some reference which is preventing my 
> app from being stopped (and garbage collected).
>
> Does this make sense? If it does, is there a good way to track down what 
> reference or references could be causing this? My app is rather large 
> (about a dozen activities, a handful of async tasks, a few 
> broadcasters/receivers, etc.), so I was really hoping for a good way to 
> track these down. 
>
>
>

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