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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:13:58+00:00 2026-05-25T20:13:58+00:00

I have a map and I want to be able add in a location

  • 0

I have a map and I want to be able add in a location from a string and have it add a marker on that location. so far I have some code that that I thought might work but i keep getting errors. I will post the code.

First Activity

LON = (EditText) findViewById (R.id.LON);
LAT = (EditText) findViewById (R.id.LAT);
SL  = (Button)   findViewById (R.id.SL);

SL.setOnClickListener(new OnClickListener(){
        public void onClick(View v){
            Intent intent = new Intent (SetLocation.this,GarageSellerActivity.class);
            intent.putExtra("lonstring", LON.getText().toString());
            intent.putExtra("latstring", LAT.getText().toString());
            startActivity(intent);
        }
});

The first activity has no errors and works as far as going to the next activity.

Second Activity

private String          LONString;
private String          LATString;

//**Turns longitude EditText into a string**\\
LONString = getIntent().getExtras().getString("lonstring", "");
//**Turns latitude EditText into a string.**\\
LATString = getIntent().getExtras().getString("latstring", "");

GeoPoint point1 = new GeoPoint(LONString,+LATString);
OverlayItem overlayitem1 = new OverlayItem(point1, "Sekai, konichiwa!", "I'm in Japan!");

itemizedoverlay1.addOverlay(overlayitem1);
mapOverlays2.add(itemizedoverlay1);'

I have errors on both .getString and on LONString and LATString inside the geopoints. Any help is appreciated.

-Thanks

  • 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-25T20:13:58+00:00Added an answer on May 25, 2026 at 8:13 pm

    You need to pass Longitude and Latitude as Integers, not Strings. Just convert them when you pass them to GeoPoint. Like this:

    GeoPoint point1 = new GeoPoint(Integer.parseInt(LONString), Integer.parseInt(LATString));
    

    You might want to do some filtering in your input as well to make sure they’re not passing anything nasty.

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

Sidebar

Related Questions

I have a map that i want to update from a separate thread. Im
I have map.resources :posts and I want to be able to serve post bodies
I have a Map, that I want to persist. The domain object is something
I have Java Map (out of Strings and Ints) objects that I want to
I have a map that represents a DB object. I want to get 'well
I have some google map markers that sit on a map. They are controlled
I want to have a map that has a homogeneous key type but heterogeneous
I have a map and I want the first column i.e (*it).first to be
I want to display google map in Android ,i have map API even map
I want to have a map (which is image-mapped) show green in areas where

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.