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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:01:45+00:00 2026-06-11T22:01:45+00:00

My application is essentially a gps tracker. It binds a service to the GPSActivity

  • 0

My application is essentially a gps tracker. It binds a service to the GPSActivity which creates a thread to calculate distance, speed and things like that.

Before I had the gps thread in the service it was in the GPSActivity and worked fine. I’m switched it to a service so it would be able to persist in the background if the user needed to use another application.

However sometimes at the beginning of the gps tracking peroid the onKeyDown method in GPSActivity is being called with out me actually pressing the button.

Does this mean that onDestroy is trying to be called and that I’m using too much memory?

Any help to explain this behavior is greatly appreciated.

  • 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-11T22:01:47+00:00Added an answer on June 11, 2026 at 10:01 pm

    I solved my problem by adjusting my onKeyDown method as follows:

        if(keyCode!=KeyEvent.KEYCODE_BACK){
            return super.onKeyDown(keyCode, event);
    
        }else{
            //must be back button
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've built an application which essentially comes in and out of focus when the
I want to implement a view in an iPhone application that is essentially like
In my application I have groups which are essentially just tags that can be
I have a program that is essentially like a paint application. However, my program
We have a java application which essentially performs ETL - reading from and writing
My application is essentially a service that is started on boot (by a boot-completed
I am working on a 64-bit .Net Windows Service application that essentially loads up
I have a cocoa application which contains a webview. Inside the webview is essentially
I have written a console application, which is essentially a Console.ReadLine()-Loop. When the application
I have a small Win32 console application which is essentially a test harness. I

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.