如何通过功能调用启用浮动操作按钮?

问题描述 投票:0回答:2

我正在使用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();
                }



           }
java android sip floating-action-button
2个回答
1
投票

您应将其分配给FloatingActionButton对象,而不是View。然后使用show()hide()方法。


0
投票

您应该使用fab.show()/fab.hide()而不是setVisibility()

© www.soinside.com 2019 - 2024. All rights reserved.