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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:28:53+00:00 2026-06-12T09:28:53+00:00

I have gone through several articles through this stack overflow and other related articles

  • 0

I have gone through several articles through this stack overflow and other related articles with reverse geocoding.

I have intended to find the name of the place with the given latitude and longitude from touch event. I got the latitude and longitude from the touch event but I couldn’t get the address from that geo coordinate, it passes in the exception rather then being in the try area,

here is the code :

public boolean onTouchEvent(MotionEvent event, MapView mapView)
{
     //---when user lifts his finger---
        //---when user lifts his finger---
         if (event.getAction() == 1) {
         GeoPoint p = mapView.getProjection().fromPixels(
         (int) event.getX(),
         (int) event.getY());
                  Toast.makeText(getBaseContext(),
         p.getLatitudeE6() / 1E6 + "," +
         p.getLongitudeE6() /1E6 ,
         Toast.LENGTH_SHORT).show();

         Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault());
         try {
         List<Address> addresses = geoCoder.getFromLocation(p.getLatitudeE6() / 1E6, p.getLongitudeE6() / 1E6, 1);

         String strCompleteAddress= "";
         if (addresses.size() > 0)
         {
         for (int i=0; i<addresses.get(0).getMaxAddressLineIndex();i++)
        strCompleteAddress+= addresses.get(0).getAddressLine(i) + "\n";
         }
         Log.i("MyLocTAG => ", strCompleteAddress);
         Toast.makeText(getBaseContext(), strCompleteAddress,            Toast.LENGTH_LONG).show();
         }
         catch (IOException e) {

         e.printStackTrace();
         Toast.makeText(getBaseContext(), "exception", Toast.LENGTH_LONG).show();
         }
         return true;
         }
         else
         return false;
     }
}   

please get me to the solution to it.

  • 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-12T09:28:54+00:00Added an answer on June 12, 2026 at 9:28 am

    so The emulator 2.2 has bug associated with Reverse Geocoding. So we need to download version like 2.1 and try. It will provide the desired result

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

Sidebar

Related Questions

There are several other questions about this topic that I have gone through, but
I have gone through several articles and examples, and have yet to find an
I have gone through Google and Stack Overflow search, but nowhere I was able
Have gone through several questions on this topic at SO, and am unable to
I have gone through this to change the color of my title bar. I'm
I have gone through this page... http://www.php.net/manual/en/function.hash.php MD5 is 32 characters long while sha1
I have gone through the fadein/fadeout tutorial that is on this page: For the
I have gone through many posts on SO regarding this issue: Tried everything in
I have gone through different questions/articles on Message Brokers and ESBs(Even on stackoverflow). Still
I have gone through several tutorials on fragments and I can't get my queries

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.