Android check has telephone call active

linquize picture linquize · Jul 2, 2013 · Viewed 7.9k times · Source

How to check if a telephone call is currently active from a non-telephone app?

What API do I need to detect this?

Answer

Tarek Hallak picture Tarek Hallak · Jul 2, 2013

try this:

public boolean isCallActive(Context context){
   AudioManager manager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
   return manager.getMode() == AudioManager.MODE_IN_CALL;
}