Something to think about. David was known for his dancing in and carrying on, when he sang to God. God considered him a man after his own heart.
Well personally I can only find or recall one incident of David dancing, at that was at the return of the Ark of the Covenant. I don't know that he was known for his carrying on.
God did not consider David a man after his own heart because of dancing, singing or carrying on.
God sought a man who would obey his will unlike king Saul
1 Samuel 13:14 But now thy kingdom shall not continue: the LORD hath sought him a man after his own heart, and the LORD hath commanded him to be captain over his people, because thou hast not kept that which the LORD commanded thee.
It was that David would fulfil the will of God that God considered him a man after his own heart...
Acts 13:22 And when he had removed him, he raised up unto them David to be their king; to whom also he gave testimony, and said, I have found David the son of Jesse,
a man after mine own heart,
which shall fulfil all my will.
Albert Barnes states it very well..
Ac 13:22
Verse 22. And when he had removed him. This was done because he rebelled against God in sparing the sheep and oxen and valuable property of Amalek, together with Agag the king, when he was commanded to destroy all, 1Sa 15:8-23. He was put to death in a battle with the Philistines, 1Sa 22:1-6. The phrase, "when he removed him," refers probably to his rejection as a king, and not to his death; for David was anointed king before the death of Saul, and almost immediately after the rejection of Saul on account of his rebellion in the business of Amalek. See 1Sa 6:12-13.
He gave testimony. He bore witness, 1Sa 13:14.
I have found David, etc. This is not quoted literally, but contains the substance of what is expressed in various places. Comp. 1Sa 13:14, with Ps 89:20; 1Sa 16:1,12.
A man after mine own heart. This expression is found in 1Sa 13:14. The connexion shows, that it means simply a man who would not be rebellious and disobedient as Saul was, but would do his will, and keep his commandments. This refers, doubtless, rather to the public than to the private character of David; or to his character as a king. It means, that he would make the will of God the great rule and law of his reign, in contradistinction from Saul, who, as a king, had disobeyed God. At the same time it is true that the prevailing character of David, as a pious, humble, devoted man, was, that he was a man after God's own heart, and was beloved by him as a saint and a holy man. He had faults; he committed sin; but who is free from it? He was guilty of great offences; but he also evinced, in a degree equally eminent, repentance, Ps 51:1-19 and not less in his private than his public character did he evince those traits which were prevailingly such as accorded with the heart, i.e., the earnest desires of God.
Which shall fulfil all my will. Saul had not done it. He had disobeyed God in a case where he had received an express command. The characteristic of David would be, that he would obey the commands of God. That David did this--that he maintained the worship of God, opposed idolatry, and sought to promote universal obedience to God among the people--is expressly recorded of him. 1Ki 14:8-9: "And thou [Jeroboam] hast not been as my servant David, who kept my commandments, and who followed me with all his heart, to do that only which was right in mine eyes," etc., 1Ki 15:3,5.
Sorry to nit-pick
