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

  • Home
  • SEARCH
  • 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 8419191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:32:44+00:00 2026-06-10T02:32:44+00:00

I modified the OMGStop() method to something more like this: public void cancelUpdates() {

  • 0

I modified the OMGStop() method to something more like this:

public void cancelUpdates() {
    //TODO potential bug here
    if(pi == null)
        setPendingIntent();
    mgr.cancel(pi);     

    //Should one of these work?
    stopService(new Intent(applicationContext, LocationPoller.class));
    stopService(new Intent(applicationContext, LocationPollerService.class));

I’m storing pi (PendingIntent) as a member in my activity class. And this works fine to remove the PendingIntent from the AlarmManager.

However…

I would like to be able to stop the current location poll if there is one going on. Is it possible with your current design? I thought I could just stop the service, but the GPS continues to run.

Basically what i’m trying to do is stop everything when the user (me on my trip) changes a preference (such as the timeout, or USE GPS or update period. And then recreate everything with the new values.

Thanks,

Great code BTW – Exactly what I want for tracking my cross country journey 🙂

  • 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-10T02:32:46+00:00Added an answer on June 10, 2026 at 2:32 am

    Is it possible with your current design?

    No, sorry. That’s theoretically possible to add, but probably a bit tricky, and definitely not there at the moment.

    Basically what i’m trying to do is stop everything when the user (me on my trip) changes a preference (such as the timeout, or USE GPS or update period. And then recreate everything with the new values.

    That is a perfectly reasonable concept, just not what LocationPoller supports. LocationPoller was designed more for the “check every hour” sorts of scenarios, where it is statistically unlikely that a check is going on while the user happens to be manipulating your app’s UI.

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

Sidebar

Related Questions

I have this method (modified code) : public static void PublishXmlForCustomTypes(MyOwnClass DefaultOutputInformation) { if
I modified one method of JQuery UI Resizable to achieve a centered resize. This
I modified this simple countdown timer form here: https://github.com/lunaryorn/snippets/blob/master/qt4/countdown.py as follows. Now I want
I modified the extension method Thorarin gave in response to this question to work
I modified a pre-designed slideshow that I found here and I would like to
Modified the code this time the objective to count the line of code was
(I modified the original question to be more meaningful) With respect to return statement,
I modified the php source file, add some printfs and now I'd like to
Modified the below circular queue code for my app. This queue can hold 32
I modified this stack question: Applying watermarks on pdf files when users try to

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.