Reputation: 665
I wanted to add custom keys in Crashlytics reports so I done something like this:
Activity 1:
Crashlytics.start(this);
Activity 2:
Crashlytics.setString(Constants.MY_KEY, "my value");
... Crashlytics.setString(Constants.MY_KEY, "my overwritten value");
Activity 3:
Crashlytics.getInstance().crash();
The problem is that there is no MY_KEY displayed in the crash info. ONLY if I set it in Activity 1 but is not getting overwritten on Activity 2.
Is there any workaround to make this work ?
Upvotes: 0
Views: 1083
Reputation: 51
I don't see anything wrong with this approach. Just make sure your custom key in Activity 2 is read before crash happens. You can put a break point or log it to make sure the setString method is called.
Upvotes: 2