Does bugsense crash handler need to be called in each activities of an Android application?
Asked Answered
A

3

7

My app has 3 activities A,B and C. From A (the "home") i can start B and from B i can start C.

Do i have to call BugSenseHandler.setup(this, MY_API_KEY); only in A or also in B and C?

Aeolic answered 23/10, 2011 at 16:41 Comment(0)
B
13

After contacting BugSense,

Android, Feb 26 13:42 (EET): Hello and thank you for contacting us, you can place it either on the application activity, or on the first activity that runs on your project. In the documentation we suggest the second practice, since it's easier and quicker for the majority of the developers.

------------------------------------------------------------------------------------------------------ BugSense

As for me, I've been placing it on the Application Activity and it has been working fine.

Benavides answered 26/2, 2013 at 11:46 Comment(0)
O
11

I've used it in several app by calling it in the onCreate of Application object (mainly so it'll catchup any errors in the app initialisation. It's also worth noting as of v3 of the jar i believe the setup method is remove and now use initAndStartSession

@Override
    public void onCreate() {
        super.onCreate();
        BugSenseHandler.initAndStartSession(this, BUG_SENSE_API_KEY);
    }
Orelie answered 22/9, 2012 at 19:51 Comment(0)
J
2

You have to call setup only on A Activity.

Jansenism answered 26/10, 2011 at 11:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.