brought here is the code for making a phone call from my Activity
public void makeAPhoneCallWithSpeakerOn()
{
String uri = "tel:" + posted_by.trim() ;
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(uri));
startActivity(intent);
}
question is:
how can I make the phone call and turn the speaker on?
10X Elad
Use an AudioManager to turn on the speakers and a CallStateListener for receiving the end of the call.
I found out that if I add the code in this following order works best for me
whereas the following not work for me if I setSpeakerphoneOn(true) at the first line: