我正在使用android sipmanager实现一个简单的sip调用。在两个座席之间建立呼叫后,我想在屏幕上列出的浮动操作按钮下方显示。但是以某种方式,它永远不会在代码列表下方激活,以使该按钮在成功调用中可见。它确实显示日志。任何帮助将不胜感激
SipAudioCall.Listener listener = new SipAudioCall.Listener() {
/**
* Name: onCallEstablished
* Description: onCallEstablished is called when the
* user establishes a call. This method
* will enable the User to talk to the
* person on the opposite line.
*/
@Override
public void onCallEstablished(SipAudioCall call) {
super.onCallEstablished(call);
call.startAudio();
call.setSpeakerMode(true);
//it does shows log in console
Log.e("$$", "Manager was instantiated");
// it doesnt change floating action button to visible
View view7 =findViewById(R.id.fab6);
view7.setVisibility(View.VISIBLE);
setText("Call ESTABLISEHED");
if (call.isMuted()) {
call.toggleMute();
}
}
您应将其分配给FloatingActionButton
对象,而不是View
。然后使用show()
和hide()
方法。
您应该使用fab.show()/fab.hide()
而不是setVisibility()