Saturday, November 10, 2012

[android-developers] Application onCreate called more than once?

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate