Anybody experiencing ANR when using MediaPlayer as service?
<p>Hi I'm getting ANR (Application Not Responding) errors but I can't understand why. If I click "Wait" everything works perfectly and the ANR doesn't come back anymore.</p>

<p>Now, I do know that when using MediaPlayer as a service is good practice using .prepareAsync and the onPrepared() method rather than simple .prepare() and .start(). It doesn't lock the UI thread and works great.</p>

<p>The problem is that all my ANRs are not happening when opening files (you would guess higher processor there), but randomly when they are playing and when the cpu is at few % at most. As I mentioned earlier NOTHING is remotely close to being unresponsive and there is little left on the UI thread.</p>

<p>The only clue is that I don't get ANRs the first time I play a track, but only after it has been changed. I thought that the prepareAsync threads were colliding and I added a lock myself. no change.</p>

<p>I tried to release the media player each time before starting a new track. no change</p>

<p>I tried to reset, stop etc in many sequences. no change.</p>

<p>Has anybody experienced the same thing?</p>

<p>As a workaround, is there any way to automatically dismiss the ANR? I know it's not the answer but I can't find any options. I am on a rooted tablet (I compiled the ROM) and it is only for myself - no distribution</p>

<p>thanks </p>
