-3

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);
             }
moe
  • 167
  • 1
  • 1
  • 6
  • 1
    Come on ... You could have asked for an IDE which can help you detect closing braces or something. – Reno May 18 '11 at 04:50

2 Answers2

3

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

jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107
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);
                 }
        };
Harinder
  • 11,776
  • 16
  • 70
  • 126