我正在使用 android sipmanager 实现一个简单的 sip 调用。一旦两个代理之间建立调用,我想在屏幕上显示下面列出的 float 操作按钮。但有些它永远不会激活下面的代码列表,以使该按钮在成功调用时可见。它确实显示日志。任何帮助将不胜感激
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()
方法。
关于java - 如何通过函数调用启用 float 操作按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58283709/