public void put(String id, DetectedActivity activity) {
SharedPreferences.Editor editor = preferences.edit();
editor.putInt(getFieldKey(id, ACTIVITY_ID), activity.getType());
editor.putInt(getFieldKey(id, CONFIDENCE_ID), activity.getConfidence());
editor.putInt(getFieldKey(id, VERSION_CODE_ID), activity.getVersionCode());
<BUG>editor.commit();
}</BUG>
public DetectedActivity get(String id) {
if (preferences != null && preferences.contains(getFieldKey(id, ACTIVITY_ID)) && preferences.contains(getFieldKey(id, CONFIDENCE_ID))) {
int activity = preferences.getInt(getFieldKey(id, ACTIVITY_ID), DetectedActivity.UNKNOWN);

public void put(String id, DetectedActivity activity) {
SharedPreferences.Editor editor = preferences.edit();
editor.putInt(getFieldKey(id, ACTIVITY_ID), activity.getType());
editor.putInt(getFieldKey(id, CONFIDENCE_ID), activity.getConfidence());
editor.putInt(getFieldKey(id, VERSION_CODE_ID), activity.getVersionCode());
editor.apply();
}
public DetectedActivity get(String id) {
if (preferences != null && preferences.contains(getFieldKey(id, ACTIVITY_ID)) && preferences.contains(getFieldKey(id, CONFIDENCE_ID))) {
int activity = preferences.getInt(getFieldKey(id, ACTIVITY_ID), DetectedActivity.UNKNOWN);
