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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:28:38+00:00 2026-05-25T02:28:38+00:00

The application doesnt point to where I am at..here is what i have done:

  • 0

The application doesnt point to where I am at..here is what i have done:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    mv=(MapView) findViewById (R.id.mapView);
    mv.setBuiltInZoomControls(true);
   // mv.setSatellite(true);
    mv.setStreetView(true);


lmanager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
    llistener=new MyLocationListener();
    lmanager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, llistener);

}

private class MyLocationListener implements LocationListener
{

    @Override
    public void onLocationChanged(Location location) {
        // TODO Auto-generated method stub
        if(location!=null)
        {
            Toast.makeText(getBaseContext(),"Location changed: "+location.getLatitude()+" lang: "+ location.getLongitude() , Toast.LENGTH_SHORT).show(); // no toast is shown
        }
         p=new GeoPoint((int)(location.getLatitude()*1E6), (int)(location.getLongitude()*1E6));
        mapC.animateTo(p);
        mapC.setZoom(18);//no zooming happens
    }



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

    }

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

    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
        // TODO Auto-generated method stub

    }

To my manifest I added both of these:

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
  • 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-25T02:28:39+00:00Added an answer on May 25, 2026 at 2:28 am

    first of all sorry for poor english. when the location was changed and you set the value into the map you need to invalidate the map using the invalidate() method of MapView class so you can get the updated value on the map

    mapC.animateTo(p);
    mapC.setZoom(18);
    mv.invalidate();
    

    as well as add after you set the value at initial time set into the map like

    mv.setBuiltInZoomControls(true);
    mv.setStreetView(true);
    mv.invalidate();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the scenario. I have an application which writes a configuration file in
I have a CI application that uses the CI session class. Here's the process
I have an application building against Android 2.1 and I want to override the
MediaElement doesnt work for me in my WPF application. mediaElement1.LoadedBehavior = MediaState.Manual; mediaElement1.Source =
QTP which access an application object in test PC screen resolution doesnt access the
I have a small application which doesn't seem to work. Please help. Server: var
I have tried this but it doesn't work: tell application Preview set myfile to
Because of the changes I have done to my post I have thinked to
I have an applications that I've built to target SDK 3.0. In this application
I have done a couple of small personal projects in .NET and following the

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.