Android Application class method onCreate being called multiple times

后端 未结 3 718
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 12:02

i\'ve overloaded the Application class in my android app and i\'m using the ACRA report system. My app looks like ( real source code here ) :

public class My         


        
3条回答
  •  醉话见心
    2020-12-05 12:15

    If you look at the stack trace, it looks like ACRA.init is calling makeApplication. I suspect that there's some sort of code to check if the application has been created already and if not, create it and that it is caused by your calling ACRA.init before super.onCreate. Generally when overriding onCreate methods (whether Application or Activity) it's recommended to call super.onCreate as the first line of your implementation and do your custom stuff afterwards. I'd give that a shot and see if it fixes things.

提交回复
热议问题