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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:28:10+00:00 2026-05-31T22:28:10+00:00

from an Activity (UI) I call a class to get my location. At onPause

  • 0

from an Activity (UI) I call a class to get my location.
At onPause in the activity I try to stop the Listeners, but the GPS icon in the status bar keeps blinking, this is the case on more devices (I read that it´s a HTC issue).

Can anybody tell me how I can fix this issue?

The GPS location class:

public GPSLocation (Context context) {
            myContext = context;

            LocatieManager=(LocationManager)myContext.getSystemService(Context.LOCATION_SERVICE);
        }   

public void StopLocationListeners(){
     // LocationManager LocatieManager=(LocationManager)myContext.getSystemService(Context.LOCATION_SERVICE);
      LocatieManager.removeUpdates(netwerklistener);
      LocatieManager.removeUpdates(gpslistener);    
      LocatieManager.removeGpsStatusListener(gpsStatusListener);
}

From the UI activity, I call mGPSLocation.StopLocationListeners(); in the onPause method, but this doesn´t work. Anybody can help me out and give a hint why this is not possible?

Thanks

  • 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-31T22:28:12+00:00Added an answer on May 31, 2026 at 10:28 pm

    You are closing GPS from public methods. but how can you be so sure that, the object which is currently running is getting close ? what I mean to say is you might have more than one object of your location class. you need to use static for such purpose, so that while closing GPS it will close the particular one only.

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

Sidebar

Related Questions

Say, if I don't call super.onPause in a override method from superclass Activity ,
I can call an Activity from a BroadcastReceiver by this way: public class AlarmReceiver
I have a conundrum, I do know how to call method from other activity..
How can i get the result back from an Activity if started from an
i need to call method from several classes, but i don't know how to
I have to call mapactivity from list activity.whenever user click on item on listview,
I have an Activity that pulls an object from an Application extended class (application
I am trying to send the events from one Java class to Activity. Scenario
I'm trying to override a class derived from Activity (called NativeActivity) so I can
Ths activity it's call from TabActivity. And I want: if I receive new notification

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.