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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:43:36+00:00 2026-05-18T21:43:36+00:00

I have a little problem… I have made an Android application which extends the

  • 0

I have a little problem… I have made an Android application which extends the webview. The webview Html page with a map on like this: Map example, it was also here I got my inspiration. My onCreate method looks like this:

super.onCreate(savedInstanceState);

         //Removes the title bar in the application
         requestWindowFeature(Window.FEATURE_NO_TITLE);
         setContentView(R.layout.main);
         
         //Creation of the Webview found in the XML Layout file
         browserView = (WebView)findViewById(R.id.webkit);

         //Removes both vertical and horizontal scroll bars 
         browserView.setVerticalScrollBarEnabled(false);
         browserView.setHorizontalScrollBarEnabled(false);
         
        
         myLocationManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
         //Enable Javascripts
      
         url = "http://www.my-homepage.dk/map_example.html";
         
         browserView.getSettings().setJavaScriptEnabled(true);

         
         //The website which is wrapped to the webview
        
         browserView.loadUrl(url);

So when My application gets a GPS location, it invokes this method:

LocationListener onLocationChange=new LocationListener() {
 
 
  public void onLocationChanged(Location location) {
 
 
 StringBuilder buf=new StringBuilder(url);
 
 buf.append("?");
 buf.append("lon=");
 buf.append(String.valueOf(location.getLongitude()));
 buf.append("&");
 buf.append("lat=");
 buf.append(String.valueOf(location.getLatitude()));
     
    browserView.loadUrl(buf.toString());
 
 }

So it basically just loads another URL…. But, my problem is, 1. it keeps the orignal website "map image", i imagined it would "unload" the page, and 2. When the second url is loaded, it takes quite a long time before it is finished, and when i am testing on my HTC Desire, it sometimes doesnt show the second loaded page (the map with location) before it turns the screen off and lock, or if i go out and in the application, that sometimes helps too…

Hope you can help 🙂

  • 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-18T21:43:37+00:00Added an answer on May 18, 2026 at 9:43 pm

    A suggestion – in onLocationChanged, make locationFound(); the first statement instead of the last.

    It would be good to stop the listener immediately, as the loadUrl statement could take some time to complete, while the provider could be sending more updates.

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

Sidebar

Related Questions

I have a problem with a little .Net web application which uses the Amazon
i have little problem in using my application application having msaccess database if i
i have little problem with boost::asio library. My app receive and process data asynchronously,
I have a little problem with a Listview. I can load it with listview
I have a little Java problem I want to translate to Python. Therefor I
I've run on a little problem today: I have a JS drop down menu
I have a little demonstration below of a peculiar problem. using System; using System.Windows.Forms;
I’m having a little Architecture problem. In my project I have a Business Logic
i have little problem with if { string nom; string ou; nom = 1;
I have little problem with specifying my variable. I have a file with normal

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.