android 括号问题

发布于 2024-11-07 22:08:00 字数 759 浏览 0 评论 0原文

大家好,谁能帮我解决这个问题,我有括号问题,有 1 个是多余的或丢失的,找不到它,

谢谢

Handler speedHandler = new Handler();

    Runnable unitspeedtimer = new Runnable() {
             public void run() {    
               speedTextView=(TextView)findViewById(R.id.speedTextView);
               MaxspeedTextView=(TextView)findViewById(R.id.MaxspeedTextView);
               //1 m/s = 3.6 km/h
               float MySpeed = location.getSpeed() * 3.6;   
              float MaxSpeed = 75.00;


                Timer updateTimer = new Timer("velocityUpdate");
              updateTimer.scheduleAtFixedRate(new TimerTask() {
                  public void run() {
                    updateGUI();
                  }
                }, 0, 3000);
             }

hi to all can any one help me with this problem i have brackets problem there is 1 that is either extra or missing cant find it

thank you

Handler speedHandler = new Handler();

    Runnable unitspeedtimer = new Runnable() {
             public void run() {    
               speedTextView=(TextView)findViewById(R.id.speedTextView);
               MaxspeedTextView=(TextView)findViewById(R.id.MaxspeedTextView);
               //1 m/s = 3.6 km/h
               float MySpeed = location.getSpeed() * 3.6;   
              float MaxSpeed = 75.00;


                Timer updateTimer = new Timer("velocityUpdate");
              updateTimer.scheduleAtFixedRate(new TimerTask() {
                  public void run() {
                    updateGUI();
                  }
                }, 0, 3000);
             }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寂寞清仓 2024-11-14 22:08:00

最后还需要一个 }; 来关闭 Runnable。一致的缩进在这里确实很有帮助。

You need one more }; at the end to close the Runnable. Consistent indentation would really help here.

下雨或天晴 2024-11-14 22:08:00
Handler speedHandler = new Handler();

        Runnable unitspeedtimer = new Runnable() {
                 public void run() {    
                   speedTextView=(TextView)findViewById(R.id.speedTextView);
                   MaxspeedTextView=(TextView)findViewById(R.id.MaxspeedTextView);
                   //1 m/s = 3.6 km/h
                   float MySpeed = location.getSpeed() * 3.6;   
                  float MaxSpeed = 75.00;


                    Timer updateTimer = new Timer("velocityUpdate");
                  updateTimer.scheduleAtFixedRate(new TimerTask() {
                      public void run() {
                        updateGUI();
                      }
                    }, 0, 3000);
                 }
        };
Handler speedHandler = new Handler();

        Runnable unitspeedtimer = new Runnable() {
                 public void run() {    
                   speedTextView=(TextView)findViewById(R.id.speedTextView);
                   MaxspeedTextView=(TextView)findViewById(R.id.MaxspeedTextView);
                   //1 m/s = 3.6 km/h
                   float MySpeed = location.getSpeed() * 3.6;   
                  float MaxSpeed = 75.00;


                    Timer updateTimer = new Timer("velocityUpdate");
                  updateTimer.scheduleAtFixedRate(new TimerTask() {
                      public void run() {
                        updateGUI();
                      }
                    }, 0, 3000);
                 }
        };
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文