1

In my HTC Desire (Froyo) , I initiated a call from the a android app and when the call ends, my android app gone to standby mode by showing

" AudioHardware pcm playback is going to standby " in log cat. when i press the back button, only then i can control my app... how can i prevent calling the standby mode..

jennifer
  • 8,133
  • 22
  • 69
  • 96
  • what do you mean by "my android app gone to standby mode" ? – bluefalcon Jul 26 '11 at 18:19
  • @ Ravi my phone has gone to standby mode....only after pressing back button , i can perform actions – jennifer Jul 27 '11 at 04:16
  • Have you seen this? http://stackoverflow.com/questions/3047817/android-audiohardware-pcm-playback-is-going-to-standby it sounds like the same issue. –  Jul 31 '11 at 20:33

1 Answers1

1

Add this permission to your AndroidManifest.xml:

<uses-permission android:name="android.permission.WAKE_LOCK" />

Then in onCreate():

PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MyTag");
mWakeLock.acquire();

And in onDestroy():

if (mWakeLock != null) {
    mWakeLock.release();
    mWakeLock = null;
}
l33t
  • 18,692
  • 16
  • 103
  • 180