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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:11:05+00:00 2026-05-27T11:11:05+00:00

I am scrounging through some tutorials and am needing to reverse geocode addresses, but

  • 0

I am scrounging through some tutorials and am needing to reverse geocode addresses, but I can’t get the examples working. The map displays, but it does not zoom to my geocoded location. Here is my code…

public class MapsActivity extends MapActivity {
    MapView mapView;
    MapController mc;
    GeoPoint p;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.mapshow);
        mapView = (MapView) findViewById(R.id.mapView);
        mc = mapView.getController();
        LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);
        View zoomView = mapView.getZoomControls();

        zoomLayout.addView(zoomView,
            new LinearLayout.LayoutParams(
                LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT));
        mapView.displayZoomControls(true);
        Geocoder geoCoder = new Geocoder(this, Locale.getDefault());
        try {
            List<Address> addresses = geoCoder.getFromLocationName(
                "empire state building", 15);
            String add = "";
            if (addresses.size() > 0) {
                p = new GeoPoint(
                    (int) (addresses.get(0).getLatitude() * 1E6),
                    (int) (addresses.get(0).getLongitude() * 1E6));
                mc.animateTo(p);
                mapView.invalidate();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    protected boolean isRouteDisplayed() {
        return false;
    }
}
  • 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-27T11:11:06+00:00Added an answer on May 27, 2026 at 11:11 am

    First Check

    Does it give you any error log?..Have you tried with another addresses?,Try writting city name …Are you trying this in emulator..then test in device cause Geocoder class don’t work in emulator..if api level is 2.2..try changing it to lower and higher..may be because of zoom level you can’t recognize the result..set it to mc.setZoom(16);

    Then Check

    I suspect the problem is within to see the result..write some Address outside the US and see if there is any difference.

    Finally

    If you have Device..try your code on it..and I am sure It will run ok or Use higher version Emulator.

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

Sidebar

Related Questions

I've been scrounging around the web looking for various typing practices of Erlang programs
i have the following divs: <div id=hidethis> <!-- here i have some more divs,
I have been scrounging for articles/info about the architecture at Facebook, the challenges &
I'm having problems getting a div to appear using jquery after 5 seconds. right
Using java, I am writting a script to anchor link an html bibliography. That
Suppose I have this wonderful function foo [92]> (defun foo () (lambda() 42)) FOO
I need to take text from a source as plain text and display it
What is the fastest way to populate a SQLite database from a DataTable in

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.