[英]how to enable a floating action button through a function call?
我正在使用 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();
}
}
您應該使用fab.show()/fab.hide()
而不是setVisibility()
您應該將其分配給FloatingActionButton
object,而不是View
。 然后使用show()
和hide()
方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.