  We study $D^0\overline{D}{}^0$ pairs produced in $e^+e^-$ collisions at
$\sqrt{s}=3.773$ GeV using a data sample of 2.92 fb$^{-1}$ collected with the
BESIII detector. We measure the asymmetry $\mathcal{A}^{CP}_{K\pi}$ of the
branching fractions of $D \to K^-\pi^+$ in $CP$-odd and $CP$-even eigenstates
to be $(12.7\pm1.3\pm0.7)\times10^{-2}$. $\mathcal{A}^{CP}_{K\pi}$ can be used
to extract the strong phase difference $\delta_{K\pi}$ between the doubly
Cabibbo-suppressed process $\overline{D}{}^{0}\to K^-\pi^+$ and the
Cabibbo-favored process $D^0\to K^- \pi^+$. Using world-average values of
external parameters, we obtain $\cos\delta_{K\pi} = 1.02\pm0.11\pm0.06\pm0.01$.
Here, the first and second uncertainties are statistical and systematic,
respectively, while the third uncertainty arises from the external parameters.
This is the most precise measurement of $\delta_{K\pi}$ to date.
