Extending Android Application class

前端 未结 1 357
旧巷少年郎
旧巷少年郎 2020-12-03 22:10

When I was searching for a solution to get the error reports from remote device, just like the test flight app in iOS, I found the acra for Android devices here

相关标签:
1条回答
  • 2020-12-03 22:38

    I wouldn't bother trying to merge your Constants class with this class. It isn't worth the effort. Just create a new class that does what is necessary for ACRA. Like this:

    public class MyApplication extends Application {
        @Override
        public void onCreate() {
            super.onCreate();
            // do the ACRA init here
        }
    }
    

    Now you need to make sure that your MyApplication class gets used. So you need to add android:name to the <application> tag entry in your manifest like so

    <application
        android:name="fully.qualified.package.name.MyApplication"
    

    Done.

    0 讨论(0)
提交回复
热议问题