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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:56:51+00:00 2026-05-27T09:56:51+00:00

I am looking for a way that allows me access an object from another

  • 0

I am looking for a way that allows me access an object from another class; both classes are within the same Android activity – OpenStreeMapActivity.java. I have:

ItemizedOverlay.java – Contains the object I want to access and modify:

private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();

BalloonOverlayView.java – Is where I want to access the object mOverlays:

    protected void setupView(final Context context, final ViewGroup parent) {

    LayoutInflater inflater = (LayoutInflater) context
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inflater.inflate(R.layout.balloon_overlay, parent);
    title = (TextView) v.findViewById(R.id.balloon_item_title);
    snippet = (TextView) v.findViewById(R.id.balloon_item_snippet);

    // Get ballon_close button and register its listener:
    ImageView close = (ImageView) v.findViewById(R.id.balloon_close);
    close.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            parent.setVisibility(GONE); 

            Intent intent = new Intent( );
            intent.setClassName( "org.example.openstreetmap", "org.example.openstreetmap.UpdateEntityActivity" );
            v.getContext().startActivity(intent);

            //HERE I return from UpdateOverlayActivity.java and is where I want to modify *mOverlays*.
        }
    });

} 

Edit: I figured out that it is not true that I return to //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-27T09:56:52+00:00Added an answer on May 27, 2026 at 9:56 am

    You can make the BalloonOverlayView hold a reference to a list of OverlayItem object this way:

    public class BalloonOverlayView{
     List<OverlayItem> items = null;
     public BalloonOverlayView(List<OverlayItem> items){
        this.items = items;
     }
     // Now you can use the ItemizedOverlay class from within this class as you wish
     public void addItem(OverlayItem item){
        items.add(item);
     }
     public void removeItem(OverlayItem item){
        item.remove(item);
     }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a way to create a data access layer that can either
In C++, I have an Object class, from which a number of other classes
I'm looking for any way that I can improve the selector performance of a
I am looking for a way to ensure that my text field (JTextField, JFormattedTextField)
I'm looking for a way to poll different servers and check that SQL server
I looking for a way, specifically in PHP that I will be guaranteed to
I'm looking for a way to create an online form that will update an
I am looking for a way to truncate a string in Python that will
I am looking for the best way to check that a database login exists
I am looking for a way to create a program in unmanaged c++ that

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.