After David committed adultery with Bathsheba, David began to contact her husband, Uriah.
2 Samuel Chapter 11 Verse 6 [New Living Translation]
6 Then David sent word to Joab: “Send me Uriah the Hittite.” So Joab sent him to David. 7 When Uriah arrived, David asked him how Joab and the army were getting along and how the war was progressing. 8 Then he told Uriah, “Go on home and relax.[b]” David even sent a gift to Uriah after he had left the palace. 9 But Uriah didn’t go home. He slept that night at the palace entrance with the king’s palace guard.
10 When David heard that Uriah had not gone home, he summoned him and asked, “What’s the matter? Why didn’t you go home last night after being away for so long?”
11 Uriah replied, “The Ark and the armies of Israel and Judah are living in tents,[c] and Joab and my master’s men are camping in the open fields. How could I go home to wine and dine and sleep with my wife? I swear that I would never do such a thing.”
12 “Well, stay here today,” David told him, “and tomorrow you may return to the army.” So Uriah stayed in Jerusalem that day and the next. 13 Then David invited him to dinner and got him drunk. But even then he couldn’t get Uriah to go home to his wife. Again he slept at the palace entrance with the king’s palace guard.
I might not know the best course of action to take after doing what David did, but I can't understand why David would choose to send Uriah back to his home. If Uriah did go back home, wouldn't he learn that his wife became pregnant? Why send him back now?