android - Lazy initialization of Fabric kits? -
is possible lazily initialize fabric kits? example, right do:
fabric.with(this, crashlytics, twittercore, tweetui); // 500ms i initialize crashlytics (no twitter stuff), below, because 10x faster, , don't need twitter stuff right away
fabric.with(this, crashlytics); // 50ms later on, when user visits activity need twittercore & tweetui, i'd add them fabric on fly before using them.
is possible ?
edit: i managed reflection, not ideal, works time being. i'm still looking proper solution this. here's how did it:
try { final fabric newfabric = (new fabric.builder(context)).kits(crashlytics, twittercore, tweetui).build(); final method method = fabric.class.getdeclaredmethod("setfabric", fabric.class); method.setaccessible(true); method.invoke(null, newfabric); } catch (exception e) { timber.e(e, e.getmessage()); }
mike fabric here. currently, respect first initialization of fabric. 1 option initialize front or if you're ok missing crashes, not initialize twitter , crashlytics until later in app's code.
Comments
Post a Comment