change preference from activity to fragment