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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:41:28+00:00 2026-06-05T16:41:28+00:00

I have an app which has a map and some POI on it. I’m

  • 0

I have an app which has a map and some POI on it.
I’m using http://djsolid.net/blog/android—draw-a-path-array-of-points-in-mapview for drawing the path.
The Pin markers are using https://github.com/jgilfelt/android-mapviewballoons to display the popup balloon with information

I’m trying to find a way to get notified in the main activity, once

protected boolean onBalloonTap(int index, OverlayItem item) 

occurs.
Everything works, regarding getting the points, drawing the balloons and popup info and when tapped (the balloon) it draws the path.
however I want to store the selected POI (there are some on the screen, I want to know which one the user selected), But since it happens on different classes, not necessarily when created, I just use a public getter of something like that.
The code for creating the overlays is:

    Drawable marker = getResources().getDrawable(R.drawable.malls);
    PinsOverlay malls= new PinsOverlay(marker, mapView);
    List<Overlay> mapOverlays= mapView.getOverlays();
    for (int i = 0; i < coordinates.length; i++) {
        long systemTime = Long.valueOf(currentTime);
        long timeSinceReported = (systemTime - Long.valueOf(time[i])) / 60;
        OverlayItem spot = new OverlayItem(coordinates[i], getAddressFromGP(coordinates[i]), getResources()
                .getString(R.string.timeSinceReported)
                + String.valueOf(timeSinceReported)
                + " "
                + getResources().getString(R.string.minutes));
        malls.addOverlay(spot);
    }
    mapOverlays.add(malls);

where coordinates[i] is the array holding all the markers’ coordinates, and getAddressFromGP(coordinates[i]) is a method for reverse GeoCoding using Google API

How can I add any sort of delegate to each overlay? is it possible?
I looked at this http://www.javaworld.com/javatips/jw-javatip10.html but couldn’t exactly understand if that’s what i’m looking for and how to implement it.

Thanks in advance.

  • 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-05T16:41:30+00:00Added an answer on June 5, 2026 at 4:41 pm

    in order to notify a class of something that has happened from another class , use the observer design pattern , often called Listener on java since they listen to an event that is supposed to occur.

    in order to notify the main thread of something that has occurred from another thread, the most common ways are :

    1. Handler.post
    2. Activity.runOnUiThread
    3. View.post
    4. AsyncTask
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android app which has native code. The native code needs to
I have a scrollable map app which for now has a huge bitmap. It
I have an app which has different app identifier for iphone and ipad and
I have an iPad app which has a funky Path-style menu which is present
I have an iPhone app which has a Table View-based data input screen with
I have made an iPhone App which has a loginwithFacebook button , the login
I have a page X in my grails app which has a button to
I have a basic iPhone/iPad app which has a ; a. List view &
I have a small data collection app which has a single button to start
I have an view in my App which has a number of buttons based

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.