@Override public void onBugReportSubmit(final Report report) { if (report.includeLogs) { lumberYard .save() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( new Subscriber<File>() { @Override public void onCompleted() { // NO-OP. } @Override public void onError(Throwable e) { Toast.makeText(context, "Couldn't attach the logs.", Toast.LENGTH_SHORT).show(); submitReport(report, null); } @Override public void onNext(File logs) { submitReport(report, logs); } }); } else { submitReport(report, null); } }
@Override public void onCreate() { super.onCreate(); AndroidThreeTen.init(this); LeakCanary.install(this); if (BuildConfig.DEBUG) { Timber.plant(new DebugTree()); } else { // TODO Crashlytics.start(this); // TODO Timber.plant(new CrashlyticsTree()); } objectGraph = ObjectGraph.create(Modules.list(this)); objectGraph.inject(this); lumberYard.cleanUp(); Timber.plant(lumberYard.tree()); registerActivityLifecycleCallbacks(activityHierarchyServer); }