Android check has telephone call active

android, phone-call

Solution

try this:

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

Problem

How to check if a telephone call is currently active from a non-telephone app? What API do I need to detect this?

Original source

Related problems