Hi All,
I'm new to the forum, very happy to be here! I'm also relatively new
to Android development and have been reading and playing with the
development environment. I've been able to have moderate success but
have recently come across something that has stumped me....hoping
someone can help.
I'm going to be writing an app that utilizes the muting of the phone's
microphone during a call, but I'm unable to get the code to work for
muting the microphone. I have the following code:
public AudioManager mgr;
mgr = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
public void MuteMicrophone(){
if (mgr.isMicrophoneMute()){
mgr.setMicrophoneMute(false);
txtMessage.setText("UNMUTE!");
}
else{
mgr.setMicrophoneMute(true);
txtMessage.setText("MUTE!");
}
There are 2 problems with the MuteMicrophone subroutine, probably
related to each other:
- every time the MuteMicrophone subroutine is called, it is going
to the else clause...it seems that mgr.isMicrophoneMute is always
returning TRUE.
- mgr.setMicrophoneMute(true) is not working
Is there something I'm doing wrong? I know that some of the phone's
functionalities require the developer to put a permission line in the
Manifest file.....is that what I'm missing?
Thank you very much for any help, and I look very forward to
contributing to the forum!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en