I am using com.crashlytics.sdk.android:crashlytics:2.3.2@aar
version of crashlytics and i disable crash reporting if user opt out.
I tried this solution but still it is not working, crash reports are still being sent to Fabric.
I am doing it as:
Preference errorReportingEnabled = findPreference(MatlistanPrefs.BUGREPORTS_SEND_AUTOMATICALLY);
errorReportingEnabled.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
Boolean value = (Boolean) newValue;
Fabric.with(DataCollectionSettingsActivity.this, new Crashlytics.Builder().
core(new CrashlyticsCore.Builder().disabled(!value).build())
.build());
return true;
}
});
Is there any working solution for this problem?
Thanks.