The oldest son could often represent his father in Israelite culture. Amnon was David's oldest son.
David knew that Amnon was not Absalom's friend.