java - 如何通过函数调用启用 float 操作按钮?

标签 java android sip floating-action-button

我正在使用 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/

相关文章:

java - 将文件路径更改为更常见的文件夹

java - [++]*+ 在正则表达式中代表什么

android - Sprite 图像在与 Libgdx 中的静态地面体碰撞后离开其动态体

c++ - osip2 编译代码块错误

java - 如何通过二维数组调用方法错误

java - 在 imageView 上的 editText 中输入图像 URL

java - 向 ListView 添加更多元素 "overwrites"当前 ListView

java - 有时键盘快捷键在 Eclipse 中不起作用?

kubernetes - 在 Google 容器引擎上运行 Freeswitch

asterisk - 如何使用负载平衡和 Asterisk 配置kamailio服务器?