Danila
Danila

Reputation: 1

When the application starts, two objects of my Application class are created. "Android Studio"

Why can two objects of my Application class be created when the application is launched? I added a timer to the MyApplication class and saw through the logs that it was started twice. Then I put the log in onCreate and declared val uuid = UUID.randomUUID() in the class itself. As a result, when the application was started, the log with the uuid was output twice. The UUID was different each time.

I don't notice anything unusual in the code. The only thing I can somehow suspect is MultiDex.install(this) and Toothpick

UPDATE: The culprit turned out to be Yandex.Metrika. The customer said that it was a vestige, so I just deleted it and did not continue to figure out how this lib did.

Upvotes: 0

Views: 22

Answers (0)

Related Questions