如何拨打电话与音箱音箱、拨打电话

2023-09-07 00:04:50 作者:心不能自持@

下面带来的是$ C $下拨打电话从我的活动

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); 
}

问题是:

我怎样才能使手机通话,并打开扬声器?

how can I make the phone call and turn the speaker on?

10倍埃拉德

推荐答案

使用的 AudioManager 以打开扬声器和一个 CallStateListener 用于接收呼叫的终点。

Use an AudioManager to turn on the speakers and a CallStateListener for receiving the end of the call.

 
精彩推荐
图片推荐