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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:41:00+00:00 2026-06-14T11:41:00+00:00

The problem: I need to put a MapView in a ViewPager More informations: As

  • 0

The problem:

I need to put a MapView in a ViewPager

More informations:

As the Mapview will be static (clickable=”false”) I won’t have any issue with scrolling, or touch events. The ViewPager will get every touch and that’s it.

What I have tried:

After a lot of Google search, I have found this awesome lib: https://github.com/inazaruk/map-fragment

My code in the Pager Adapter:

@Override
public Fragment getItem(int position) {
        return new MyMapFragment(itineraries);
}

and my Constructor in the MyMapFragment:

public ArrayList<Itinerary> itineraries;

public MyMapFragment(ArrayList<Itinerary> itineraries) {
    super();
    this.itineraries = itineraries;
}

And that’s working, I am really happy happy with the result and the behaviour when clicked is set to false

My Question:

As I want to draw the itineraries, I am completely stuck.

The MapFragment does not have any of the Mapview functions.
I know I can edit the MyMapActivity class and make everything work there, but how is that possible to send the ArrayList from the Fragment to the Activity?

Currently the MapACtivity does not have any variable to draw the markers. All these informations are in the MapFragment

  • 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-14T11:41:01+00:00Added an answer on June 14, 2026 at 11:41 am

    As I understand you right, use ItemizedOverlay<OverlayItem> (just put image instead to draw the marker on the map).

    public class MyViewActivity extends MapActivity {
    ....
    OverlayItem myMarker;
    MapView myMapView;
    ItemizedOverlay<OverlayItem> mItemizedoverlay;
    GeoPoint mCurrentPoint;
    
    ....
    
    Drawable drawable = this.getResources().getDrawable(R.drawable.target);
        mItemizedoverlay = new MyItemizedOverlay(drawable, this);
    
    ....
    
    Address address = ...;
    ....
    mCurrentPoint = new GeoPoint((int) (address.getLatitude() * 1E6), (int) (address.getLongitude() * 1E6));
    myMarker = new OverlayItem(mCurrentPoint, "Submit", toSearch);
                mItemizedoverlay.addOverlay(myMarker);
                myMapView.getOverlays().add(mItemizedoverlay);
    
    ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem: I need to put on two or more rows
i have a problem, i need to put 3 buttons in a android layout,
I have problem with my Android application. I need an application that will send
I have the following problem, I need to put in a script that is
I need to override Backbone.sync to allow PUT the problem is i don't know
Short explanation of my problem, I need to parse an object and put its
I have problem i need to convert from my Array structure to std::vector<int> ...
I have a text (with several lines) that I need to put in a
I have some CLOB columns in a database that I need to put Base64
I have a set of numbers which I need to put on a rectangular

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.