Consider choosing $\theta^*$ that minimizes the expected absolute loss:
\begin{align} \tag{1} \int_{\Theta}|\theta-\theta^*|\pi(\theta|\mathbf{x})d\theta= \int_{-\infty}^{\theta^*}(\theta^*-\theta)\pi( \theta|\mathbf{x})d\theta+\int_{\theta^*}^{\infty}(\theta-\theta^*)\pi(\theta|\mathbf{x})d\theta \end{align}
Differentiating with respect to $\theta^*$ and equating to zero yields: \begin{align} \tag{2} \int_{-\infty}^{\widehat{\theta^*}}\pi(\theta|\mathbf{x})d\theta = \int_{\widehat{\theta^*}}^{\infty}\pi(\theta|\mathbf{x})d\theta \end{align}
EDITED:
I'm confused about the step taken from (1) to (2), which can be found on p. 12 (94) in online notes (Note: I replaced $\delta(\mathbf{x})$ by $\theta^*$) . A more detailed insight will be highly appreciated. My understanding is that it makes use of Leibniz rule. Here $\widehat{\theta^*}$ is the Bayes estimate (which turns out to be the median of $\pi(\theta|\mathbf{x})$), an argument that minimizes (1).