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

2012-11-12 Thread Zsolt Vasvari
>  Post your manifest.xml. I assume that you have your broadcastreceiver or 
some service running in a separate process. That would cause 
Application.onCreate to be called multiple times.

It would?  Please provide a source for this piece of tidbit.


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

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

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

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

2012-11-12 Thread Craig
Thanks - I read that post; it seems to be stuck in the same place I am. 

I suspect a memory leak that is keeping some app state alive across app 
shutdown and restart, and what I'd really like is some easy way to analyze 
what memory isn't being reclaimed when Android closes my app. 



On Sunday, November 11, 2012 9:18:37 PM UTC-5, Nikolay Elenkov wrote:
>
> On Mon, Nov 12, 2012 at 7:17 AM, Nobu Games 
> > 
> wrote: 
> > Post your manifest.xml. I assume that you have your broadcastreceiver or 
> > some service running in a separate process. That would cause 
> > Application.onCreate to be called multiple times. 
> > 
>
> ACRA keeps track of initialization using a static variable, so with 
> multiple processes 
> this should not happen. I've seen this too in error reports, still no 
> idea why it happens. 
> Here's a related issue: 
>
> https://github.com/ACRA/acra/issues/3 
>

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

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

2012-11-12 Thread Craig
I don't have any process attributes in my manifest.xml... here it is:


http://schemas.android.com/apk/res/android";
package="com.comp.duh.rm" android:versionCode="1"
android:versionName="@string/versionName">
















 


 


 


















 

































On Sunday, November 11, 2012 5:17:28 PM UTC-5, Nobu Games wrote:
>
> Post your manifest.xml. I assume that you have your broadcastreceiver or 
> some service running in a separate process. That would cause 
> Application.onCreate to be called multiple times.
>
> On Saturday, November 10, 2012 3:32:42 PM UTC-6, 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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

2012-11-11 Thread Nikolay Elenkov
On Mon, Nov 12, 2012 at 7:17 AM, Nobu Games  wrote:
> Post your manifest.xml. I assume that you have your broadcastreceiver or
> some service running in a separate process. That would cause
> Application.onCreate to be called multiple times.
>

ACRA keeps track of initialization using a static variable, so with
multiple processes
this should not happen. I've seen this too in error reports, still no
idea why it happens.
Here's a related issue:

https://github.com/ACRA/acra/issues/3

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


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

2012-11-11 Thread Craig
Here's my manifest.xml (with no process attributes):


http://schemas.android.com/apk/res/android";
package="com.mypackage.rm" android:versionCode="1"
android:versionName="@string/versionName">
















 


 


 


















 














   serv
















On Sunday, November 11, 2012 5:17:28 PM UTC-5, Nobu Games wrote:
>
> Post your manifest.xml. I assume that you have your broadcastreceiver or 
> some service running in a separate process. That would cause 
> Application.onCreate to be called multiple times.
>
> On Saturday, November 10, 2012 3:32:42 PM UTC-6, 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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

2012-11-11 Thread Nobu Games
Post your manifest.xml. I assume that you have your broadcastreceiver or 
some service running in a separate process. That would cause 
Application.onCreate to be called multiple times.

On Saturday, November 10, 2012 3:32:42 PM UTC-6, 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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

2012-11-11 Thread TreKing
I think you should provide more details regarding what you're seeing that
makes you think the process is starting over again.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

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

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

2012-11-11 Thread Craig
My process getting killed should not be an issue, as long as it dies. I'm 
scheduling alarms to start it up at different times - the issue I seem to 
be having is that multiple instances of my process run at the same time...



On Sunday, November 11, 2012 3:27:30 AM UTC-5, Nitin Sethi wrote:
>
> The onCreate.. method of the class extending Application is called only 
> once unless the process gets killed somehow and restarted. You can 
> investigate for any reason(s) of your process getting killed.
>
> On Sunday, 11 November 2012 03:02:42 UTC+5:30, 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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

2012-11-11 Thread Nitin Sethi
The onCreate.. method of the class extending Application is called only 
once unless the process gets killed somehow and restarted. You can 
investigate for any reason(s) of your process getting killed.

On Sunday, 11 November 2012 03:02:42 UTC+5:30, 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Application#onCreate() called more than once?

2012-01-10 Thread Mukesh Srivastav
Instead of starting the service on onCreate(), you need to do the following
things.

1. start the service onPause.

2. check if service is not started.

-- 
Warm Regards,
*Mukesh Kumar*,
Android Consultant/Freelancer,
India,Hyderabad.

On Tue, Jan 10, 2012 at 2:03 PM, srihari babu wrote:

> Is there any remote service kind of thing is there?
> Since i have observed this kind of behaviour in my application, in which i
> used to create remote service.
> On starting remote service, application onCreate method got executed.
>
> I think it may helpful to u.
>
> Regards,
> Srihari babu.R
> Hyderabad
>
> --
> 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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] Re: Application#onCreate() called more than once?

2012-01-10 Thread Nikolay Elenkov
On Tue, Jan 10, 2012 at 5:33 PM, srihari babu  wrote:
> Is there any remote service kind of thing is there?
> Since i have observed this kind of behaviour in my application, in which i
> used to create remote service.
> On starting remote service, application onCreate method got executed.
>

No, no remote services. This doesn't happen all the time, just sometimes,
and I haven't been able to reproduce it on my devices.

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


[android-developers] Re: Application#onCreate() called more than once?

2012-01-10 Thread srihari babu
Is there any remote service kind of thing is there?
Since i have observed this kind of behaviour in my application, in which i 
used to create remote service.
On starting remote service, application onCreate method got executed.

I think it may helpful to u.

Regards,
Srihari babu.R
Hyderabad

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