How preference activity is used to set preferences