Android API to check if call is Active or On Hold-ThrowExceptions

Exception or error:

Is there an API function to check if a call is currently Active, or if has been put on Hold?

Assuming I have two connected calls, is there a way to check if each one is active, on-hold, or maybe they are connected in a conference call?

How to solve:

Yes, you can check if a call is active over device or not:

public static boolean isCallActive(Context context){
   AudioManager manager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
   if(manager.getMode()==AudioManager.MODE_IN_CALL){
         return true;
   }
   else{
       return false;
   }
}

Leave a Reply

Your email address will not be published. Required fields are marked *