Android Application class being called twice

Viewed 10051

In my Android application, I overload the Application class, and I updated the tag in my manifest. This application also creates an Android Service. I have put some logs in the onCreate of my Application class, and I see it being called twice. The first time is when my application gets launched (this is expected) and then, it's usually right after the Service is being created. the log also shows that a second instance of the Application is being created. (I print the "this" value and they are different).

I thought the Application would be created as a singleton. Is that happening because I create a Service?

4 Answers

I just had this issue and after reading all this, nothing helped. Here is what helped me.

Add the attribute MainLauncher = true to your MainActivity.cs class.

Related