Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8270255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:31:44+00:00 2026-06-08T06:31:44+00:00

I keep getting this error saying Syntax error on token }, delete this token.

  • 0

I keep getting this error saying “Syntax error on token “}”, delete this token.” on the last line, why? I have searching for the error but I can’t seem to find it. As you can see it’s a service, calling on another service every once in a while.

package com.iggeman.updater;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class UpdaterService extends Service {

private static final String TAG = UpdaterService.class
        .getSimpleName();
private Updater updater;
public boolean isRunning = false;

@Override
public IBinder onBind(Intent intent) {
    // TODO Auto-generated method stub
    return null;
}

@Override
public void onCreate() {
    // TODO Auto-generated method stub
    super.onCreate();

    updater = new Updater();

    Log.d(TAG, "onCreate");
}

@Override
public void onStart(Intent intent, int startId) {
    // TODO Auto-generated method stub
    super.onStart(intent, startId);

    if (this.isRunning == false) {
        updater.start();
        this.isRunning = true;
    }

    Log.d(TAG, "onStart");
}

@Override
public synchronized void onDestroy() {
    // TODO Auto-generated method stub
    super.onDestroy();

    if (this.isRunning) {
        updater.interrupt();
    }

    updater = null;

    Log.d(TAG, "onDestroy");
}

class Updater extends Thread {
    static final long DELAY = 10000;
    private boolean isRunning = false;

    public Updater() {
        super("Updater");
    }

    @Override
    public void run() {
        // TODO Auto-generated method stub
        super.run();
        isRunning = true;
        while (isRunning) {
            try {
                // Do something

                startService(new Intent(getBaseContext(), StartServiceTwo.class));

                Log.d(TAG, "Updater running");

                Thread.sleep(DELAY);
            } catch (InterruptedException e) {
                // interrupted
                isRunning = false;
            }
        } // while
    }

    public boolean isRunning() {
        return this.isRunning();
    }
}
}

I have gone through all the brackets and I can’t find anyone that isn’t where it’s supposed to be.

Edit:

Still the error:

package com.iggeman.updater;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class UpdaterService extends Service {

private static final String TAG = UpdaterService.class
        .getSimpleName();
private Updater updater;
public boolean isRunning = false;

@Override
public IBinder onBind(Intent intent) {
    // TODO Auto-generated method stub
    return null;
}

@Override
public void onCreate() {
    // TODO Auto-generated method stub
    super.onCreate();

    updater = new Updater();

    Log.d(TAG, "onCreate");
}

@Override
public void onStart(Intent intent, int startId) {
    // TODO Auto-generated method stub
    super.onStart(intent, startId);

    if (this.isRunning == false) {
        updater.start();
        this.isRunning = true;
    }

    Log.d(TAG, "onStart");
}

@Override
public synchronized void onDestroy() {
    // TODO Auto-generated method stub
    super.onDestroy();

    if (this.isRunning) {
        updater.interrupt();
    }

    updater = null;

    Log.d(TAG, "onDestroy");
}

class Updater extends Thread {
    static final long DELAY = 10000;
    private boolean isRunning = false;

    public Updater() {
        super("Updater");
    }

    @Override
    public void run() {
        // TODO Auto-generated method stub
        super.run();
        isRunning = true;
        while (isRunning) {
            try {
                // Do something

                startService(new Intent(getBaseContext(), StartServiceTwo.class));

                Log.d(TAG, "Updater running");

                Thread.sleep(DELAY);
            } catch (InterruptedException e) {
                // interrupted
                isRunning = false;
            }
        } // while
    } //Run     
} //Class updater

public boolean isRunning() {
        return this.isRunning();
   }
}  //Main body
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:31:45+00:00Added an answer on June 8, 2026 at 6:31 am

    This is likely not an issue with your code, but Eclipse. Restart the computer, and then re-build the project.

    If that does not work, try compiling with another program. If it works, then it’s just Eclipse being weird.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't find any info on this... I keep getting some error saying I
I keep getting this error and have no idea why. I googled and scanned
I keep getting this error in the $('#savetickets-list') line. I want to dynamically add
I keep getting this error saying that it cannot find my javascript function checkpw().
i keep getting this error for an array of errors that i have set
I have this header file ... for some reason I keep getting an error
I have this code that should update my access database, but I keep getting
Keep getting this error after inserting a subdatasheet into a query and trying to
I keep getting this error on emulator: I copied this from a tutorial and
I keep getting this error Error in readPNG(destfile) : libpng error: PLTE: CRC error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.