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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:56:53+00:00 2026-06-02T01:56:53+00:00

I have a ListView that is bound to a data adapter that displays distances

  • 0

I have a ListView that is bound to a data adapter that displays distances of fixed landmarks after I create and load my location object with the device’s geoloc (lat/long). The problem is, on average, the code below takes 3-7 seconds to load, the longer process is the call “requestLocationUpdates()” which sometimes can take minutes to load if there is no NETWORK_SERVICE and the GPS_SERVICE becomes the primary, making my Activity ListView blank

Is the OnCreate() Activity method the best place for requestLocationUpdates() to be called?

locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
locationListener = new GeoLocationListener();

    Criteria criteria = new Criteria();
    criteria.setAccuracy(Criteria.ACCURACY_FINE);
    criteria.setAltitudeRequired(false);
    criteria.setBearingRequired(false);
    criteria.setCostAllowed(false);
    criteria.setSpeedRequired(false);
    criteria.setPowerRequirement(Criteria.POWER_LOW);

    String provider = locationManager.getBestProvider(criteria, true);        

    locationManager.requestLocationUpdates(provider,
        0, //300000, // TODO: Default to Check Every 5 Minutes OR
            0, //500,   // TODO: Default to Check if device moves more than 500 meters
            locationListener); 
  • 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-02T01:56:55+00:00Added an answer on June 2, 2026 at 1:56 am

    Use getLastKnownLocation first to display the latest known location in the list view to avoid showing empty list then call requestLocationUpdates, I can’t see any problem reagrding calling it in the onCreate method.

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

Sidebar

Related Questions

I have a listview that is bound to an object and in the listview
I have a ListView in a ListActivity that's bound to some data. I have
I have a ListView that is data bound and I want to alter the
I have a WPF ListView that is bound to a BindingList<T>. The binding works
I have a ListView with a GridView that's bound to the properties of a
I have a SQLDataSource that is bound to a ListView control but I want
I have ListView that uses a GridView to display several columns of data. Two
In my latest project, I have a ListView that is bound to an ObservableCollection
I have a listview that is bound to a sqldatasource. I know how to
I have a listview with some data bound to it. In this data are

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.