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 3598968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:18:32+00:00 2026-05-18T20:18:32+00:00

i have a background service on my android APP that is getting my GPS

  • 0

i have a background service on my android APP that is getting my GPS position and sending it to a remote db. It work’s fine.

The problem is when i want to stop the service…. it doesn’t stops :S. Also no exception or errors on logcat have appeared… it simply doesn’t stops.

this is the code to start my srvice (with a button):

startService(new Intent(GPSLoc.this, MyService.class)); //enciendo el service

this is the code where I stop it (on the onactivityresult method):

stopService(new Intent(GPSLoc.this, MyService.class));

I have been debugged the app, and i checked that the stopService codeline has been called every time that i debugged it, but it doesn’t stops……

i am sure that it’s not stopped cause on my database i still recive gps positions from the emulator when i have press the button to stop the service.

what i am doing bad?

  • 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-05-18T20:18:32+00:00Added an answer on May 18, 2026 at 8:18 pm

    Have you implemented onDestroy()? If not, I believe that might be the solution – and you stop your Timer or whatever you’re using to run the service within onDestroy().

    A service can be stopped by calling its stopSelf() method, or by calling Context.stopService().

    See this link for some more information.

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

Sidebar

Related Questions

i have a background service on my android APP that is getting my GPS
I have an android app that uses a background service for uploading data. When
I have an android app that listens for json commands over a socket. I
I have an Android application with a background running Service. When the Service crashes
I've implemented a Service in my android app that starts a timer (using the
Ok so I have an android app with an Activity (UI) and a Service
I'm developing an Android application that consists of: a lightweight background service that logs
Background I have made a Web Service in Visual Studio, and I'm trying to
Background: I have a little video playing app with a UI inspired by the
Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e.

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.