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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:33:55+00:00 2026-05-21T09:33:55+00:00

Although I set minTime to 10 seconds in the requestLocatioupdate method I still get

  • 0

Although I set minTime to 10 seconds in the requestLocatioupdate method I still get new location in less than one second.

 public class GpsActivity extends Activity {
LocationManager mLocationManager;
TextView mTextView;
int count;
     /** Called when the activity is first created. */
     @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mTextView = (TextView) findViewById(R.id.text);
        count = 0;
        mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
        mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 0,mGpsLocationListener);
     } 

     Handler mHandler = new Handler(){

         @Override
         public void handleMessage(Message msg){
             switch(msg.what){
             case 1:
                 mTextView.setText("new location count:"+count);
             }
         }
    };

    LocationListener mGpsLocationListener = new LocationListener(){

    @Override
    public void onLocationChanged(Location location) {
        count++;
        mHandler.sendEmptyMessage(1);

    }

    @Override
    public void onProviderDisabled(String arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onProviderEnabled(String arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
        // TODO Auto-generated method stub

    }

    };

}

My program is written for android 2.2

Any idea?

Thanks in advance.

  • 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-21T09:33:56+00:00Added an answer on May 21, 2026 at 9:33 am

    you can set a distance .if not solve,youcan see :minTime the minimum time interval for notifications, in milliseconds. This field is only used as a hint to conserve power, and actual time between location updates may be greater or lesser than this value.
    minDistance the minimum distance interval for notifications, in meters

    so i think the time not correct,if you hope update 10s,i think you should use Time andTimeTask,or handler. or you can look http://androidforums.com/developer-101/107085-proper-provider-parameter-requestlocationupdates.html

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

Sidebar

Related Questions

Although ASP.NET MVC seems to have all the hype these days, WebForms are still
I'm having problems with images in a table. Although I set tr width=95, and
Although I've set isPersistent to false, the authorization cookie is persisted between sessions. This
Although I have set cache:false in a jQuery AJAX Post request, it does not
Although I have set hoverrows: false, a tooltip is being displayed when the mouse
Although I know this isn't very efficient, I need to get this working fast
Although I'm specifically interested in web application information, I would also be somewhat curious
Although somewhat related to this question , I have what I think is a
Although I don't have an iPhone to test this out, my colleague told me
Although I do understand the serious implications of playing with this function (or at

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.