private void setEnableSynchronization(int position) { boolean isChecked = objAdapter.getItem(position).isChecked(); objAdapter.getItem(position).setChecked(!isChecked); SharedPreferencesHelper.saveBoolean( SharedPreferencesHelper.ENABLE_SYNCHRONIZATION, !isChecked, context); objAdapter.notifyDataSetChanged(); }
private void setAskForLocationPermission(int position) { if (objAdapter.getItem(position).isChecked()) { objAdapter.getItem(position).setChecked(false); SharedPreferencesHelper.saveBoolean( SharedPreferencesHelper.LOCATION_PERMISSION_SHOW_AGAIN_MSG, false, getActivity()); } else { objAdapter.getItem(position).setChecked(true); SharedPreferencesHelper.saveBoolean( SharedPreferencesHelper.LOCATION_PERMISSION_SHOW_AGAIN_MSG, true, getActivity()); } objAdapter.notifyDataSetChanged(); }
private void setRecipeAddDefaultSetting(int position) { if (objAdapter.getItem(position).isChecked()) { objAdapter.getItem(position).setChecked(false); SharedPreferencesHelper.saveBoolean( SharedPreferencesHelper.ASK_TO_ADD_DEFAULT_RECIPES, false, getActivity()); } else { objAdapter.getItem(position).setChecked(true); SharedPreferencesHelper.saveBoolean( SharedPreferencesHelper.ASK_TO_ADD_DEFAULT_RECIPES, true, getActivity()); } objAdapter.notifyDataSetChanged(); }
private void setRecipeDeletionSetting(int position) { if (objAdapter.getItem(position).isChecked()) { objAdapter.getItem(position).setChecked(false); SharedPreferencesHelper.saveBoolean( SharedPreferencesHelper.RECIPE_DELETION_SHOW_AGAIN_MSG, false, getActivity()); } else { objAdapter.getItem(position).setChecked(true); SharedPreferencesHelper.saveBoolean( SharedPreferencesHelper.RECIPE_DELETION_SHOW_AGAIN_MSG, true, getActivity()); } objAdapter.notifyDataSetChanged(); }