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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:58:11+00:00 2026-05-31T15:58:11+00:00

I am currently using a timer to determine if a location listener has timed

  • 0

I am currently using a timer to determine if a location listener has timed out ? The problem is that the gps remains on. I don’t know why , is there a method i can override when the locationlistener times out or a more elegant method ?

  • 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-31T15:58:12+00:00Added an answer on May 31, 2026 at 3:58 pm

    Consider adding a GPS status listener to your location manager. The status listener is informed when the GPS starts, stops, receives a first fix, or the satellite status (no. of visible satellites, you need at least 4 for a fix) changes.

    The listener may look like this:

    class GpsStatusListener implements GpsStatus.Listener {
    
        @Override
        public void onGpsStatusChanged(final int event) {
            switch( event ) {
                            // ...
                break;
            case GpsStatus.GPS_EVENT_STOPPED:
                            // ...
                break;
            case GpsStatus.GPS_EVENT_FIRST_FIX:
                            // ...
                break;
            case GpsStatus.GPS_EVENT_SATELLITE_STATUS:
                            // ...
                break;
            }
        }
    }
    

    It is added as follows:

    lm.addGpsStatusListener(new GpsStatusListener());
    

    You don’t need to remove the location listener when the GPS status changes.

    You also can get additional information from the location manager by overriding one of the following methods:

    public void onStatusChanged(final String provider, final int status, final Bundle extras) {
        switch( status ) {
        case LocationProvider.AVAILABLE:
                    // ...
            break;
        case LocationProvider.OUT_OF_SERVICE:
                    // ...
            break;
        case LocationProvider.TEMPORARILY_UNAVAILABLE:
                    // ...
            break;
        }
    }
    
    @Override
    public void onProviderEnabled(final String provider) {
                    // ...
    }
    
    @Override
    public void onProviderDisabled(final String provider) {
                    // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to find the currently running SharePoint 2007 Timer jobs using STSADM?
I have this problem when I deploy, I really don't know how to solve
We currently have multiple .NET projects that we have developed using Visual Studio. Each
I'm currently developing a percussion tutorial program. The program requires that I can determine
Our customer would like to know who is online and currently using the custom
Does anyone know an elegant way to determine System Load preferably using Windows performance
*I'm using Java. I have this thread, agent, that explores a room to determine
I'm using time elapsed as a variable in a program which I am currently
I'm currently using this code to calculate the sunrise / sunset times. (To be
I'm currently trying to access a REST API for the first time using visual

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.