Move beacon code to fragment from activity.