In the Bible, that phrase was only applied to one person: David of Bethlehem, the son of Jesse, who would become Israel's greatest king. "The Lord has sought out a man after his own heart and appointed him ruler of his people, because you have not kept the Lord’s command.” (1 Samuel 13.14) He would unite and expand Israel as no other could do, and would author the greater portion of the Psalms. How can I equate myself to that? Well, I can't, if you think "after one's own heart" means "having the same opinions or interests." (Cambridge Dictionary definition)
Yet David was not allowed to build the Temple. Solomon hinted rather nicely that his father "was not able to build a Temple to honor the name of the LORD his God because of the many wars waged against him by surrounding nations. He could not build until the LORD gave him victory over all his enemies." (1 Kings 5.3) But the ultimate reason was because David was an adulterer and murderer. "Now, therefore, the sword will never depart from your house, because you despised me and took the wife of Uriah the Hittite to be your own." (2 Samuel 12.10)
So if David "despised" God in this way, how does that make him one with "the same opinions or interests" as God? Simple. It doesn't. Now, I give thanks that I've never done either of those things, but I have managed to "despise" God plenty through my own sin.
A little language history-- Our common phrase "after my own heart" comes from our translation of 1 Kings 5.3. That's how it has always been translated, and over about 400 years the modern meaning has changed as our language has changed. Like all of the Bible, we need to try to understand it the same way as the one who originally wrote it. In biblical Hebrew, that phrase is one word, "kil'vavo:"
- ki is "as, like, as if, according to, after."
- l'vav is "heart."
- o is "his."
Whatever the circumstances-- in times of peace or war, whether fighting or hiding, when writing a psalm, or even while murdering his lover's husband-- David always thirsted for, hungered after, and hunted for the heart of God. Like my namesake, in triumph or failure, in right or in wrong, I am always hunting for the heart of God. A man after God's own heart.