“He hated Cruz, then liked him, then hated him, now he liked him. ....”
Next will be Rubio.
Also, maybe Trump heard callers to talk show saying they were for Trump, until he started attacking Cruz.
It depends on the circumstances around which these ‘endorsements’ or ‘detractions’ are made. Trump says what he says, he calls it like he sees it, and then he moves on.
It is just the way he has always been. No polling necessary .