我最近才开始研究 sinch SDK。如果来电者在悔改接受来电之前已经挂断电话,我对如何处理来电感到困惑。现在有方法如何处理这种情况。这是我正在处理 inconimg 调用的代码
sinchClient.getCallClient().addCallClientListener(new CallClientListener() {
@Override
public void onIncomingCall(CallClient callClient, final Call call) {
mAudioPlayer = new AudioPlayer(HomeActivity.this);
mAudioPlayer.playRingtone();
Dialog dialog = new Dialog(HomeActivity.this);
dialog.setContentView(R.layout.incoming_call_notification);
dialog.setTitle("Incoming Call");
TextView callerName = (TextView) dialog.findViewById(R.id.incoming_caller_name);
CircularImageView callerProfileImage = (CircularImageView) dialog.findViewById(R.id.profile_image_incoming_call);
Button pickCallBtn = (Button) dialog.findViewById(R.id.incomming_call_pick_up);
Button hangUpCall = (Button) dialog.findViewById(R.id.incomming_call_hang_up);
pickCallBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mAudioPlayer.stopRingtone();
call.answer();
}
});
hangUpCall.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mAudioPlayer.stopRingtone();
if (call!=null){
call.hangup();
}
}
});
}
});
提前致谢!!