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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:39:53+00:00 2026-05-25T21:39:53+00:00

I just started Android development and working on a little app related to google

  • 0

I just started Android development and working on a little app related to google maps api. Am using the Google Map View for this and following this tutorial..
I’ve created a custom itemizedOverlay, which has a constructor like this(as told in the tutorial) –

public pujaItemizedOverlay(Drawable defaultMarker, Context context) {
    super(defaultMarker);
    mContext = context;
}

I have a image file named sprite.png in the res/drawable/ forder. And here is my onCreate() function –

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

        MapView mapView = (MapView) findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);

        List<Overlay> mapOverlays = mapView.getOverlays();
        Drawable drawable = this.getResources().getDrawable(R.drawable.sprite);
        pujaItemizedOverlay itemizedoverlay = new pujaItemizedOverlay(drawable, this);

        GeoPoint point = new GeoPoint(19240000,-99120000);
        OverlayItem overlayitem = new OverlayItem(point, "Hola, Mundo!", "I'm in Mexico City!");

        itemizedoverlay.addOverlay(overlayitem);
        mapOverlays.add(itemizedoverlay);
    }

The problem is, The image named sprite doesn’t show up on the map.
One this I’d like to mention is that, according to the tutorial, they added a second paramete to the constructor of the custom itemizedOverlay of the class Context. But in their example, when they called that overlay, they provided only one parameter(check the tutorial page), like –
HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable);
Eclipse showed an obvious error in this line, so I added the second parameter as this to provide the current context. Am I doing it right here?
Update:
The image in question is here.

  • 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-25T21:39:54+00:00Added an answer on May 25, 2026 at 9:39 pm

    Found the solution here. It seems that if the mapview doesn’t know how to align the image it won’t show it at all.

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

Sidebar

Related Questions

Im very new to this android development.I just started to create a hello world
I've just started learning Android development and as a little project, I'm building a
I'm just getting started with Android app development on a Mac, and I keep
I just started development for Android, and I am stuck with this code: public
I just started doing some Android app development, and I decided I'm going to
I have just started Android application development, I have develop the application of Google
Just started with some basic android development and I made a little menu with
I am working on an Android application. I just started on android development and
Just getting started with Android development and Java. So, here's the code I'm working
I'm just starting to learn Android development and writing my first app. I started

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.