Android Application class method onCreate being called multiple times

后端 未结 3 711
伪装坚强ぢ
伪装坚强ぢ 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:29

    I'm also seeing this with ACRA 4.4.0 in the wild.

    Perhaps something as simple as this under the init method?

    if (mApplication != null) {
        throw new IllegalStateException("ACRA#init called more than once");
        //(return or finish or gracefully exit somehow)       
    } else {
        mApplication = app;
        //and then continue with rest of acra init...
    

    Edit: 12/27/12 As a follow up to this, it looks like Kevin has adopted these changes. Details are here: https://github.com/ACRA/acra/commit/cda06f5b803a09e9e7cc7dafae2c65c8fa69b861

提交回复
热议问题