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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:37:09+00:00 2026-06-12T16:37:09+00:00

I am using android google map there are different pins on map and nam

  • 0

I am using android google map there are different pins on map and nam and close button and a move button.popup is showing on map but when click another pin give exception as:-

10-06 22:17:17.080: E/AndroidRuntime(25156): FATAL EXCEPTION: main
10-06 22:17:17.080: E/AndroidRuntime(25156): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
10-06 22:17:17.080: E/AndroidRuntime(25156):    at android.view.ViewGroup.addViewInner(ViewGroup.java:3011)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at android.view.ViewGroup.addView(ViewGroup.java:2900)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at android.view.ViewGroup.addView(ViewGroup.java:2880)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at com.appstudioz.bidnear.map.BidNearItemizedOverlay.onTap(BidNearItemizedOverlay.java:85)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:356)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:533)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at com.google.android.maps.MapView.onTouchEvent(MapView.java:683)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at android.view.View.dispatchTouchEvent(View.java:4609)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1554)
10-06 22:17:17.080: E/AndroidRuntime(25156):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1320)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
  10-06 22:17:17.080: E/AndroidRuntime(25156):  at  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1732)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1267)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.app.Activity.dispatchTouchEvent(Activity.java:2315)
  10-06 22:17:17.080: E/AndroidRuntime(25156):  at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1705)
 10-06 22:17:17.080: E/AndroidRuntime(25156):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
  10-06 22:17:17.080: E/AndroidRuntime(25156):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
  10-06 22:17:17.080: E/AndroidRuntime(25156):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at  android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
  10-06 22:17:17.080: E/AndroidRuntime(25156):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1560)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1333)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1732)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1267)
    10-06 22:17:17.080: E/AndroidRuntime(25156):    at android.app.Activity.dispatchTouchEvent(Activity.java:2315)
    10-06 22:17:17.080: E/AndroidRuntime(25156):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1705)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.View.dispatchPointerEvent(View.java:4677)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2394)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.view.ViewRoot.handleMessage(ViewRoot.java:2054)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at android.os.Handler.dispatchMessage(Handler.java:99)
  10-06 22:17:17.080: E/AndroidRuntime(25156):  at android.os.Looper.loop(Looper.java:132)
  10-06 22:17:17.080: E/AndroidRuntime(25156):  at android.app.ActivityThread.main(ActivityThread.java:4123)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at java.lang.reflect.Method.invokeNative(Native Method)
  10-06 22:17:17.080: E/AndroidRuntime(25156):  at java.lang.reflect.Method.invoke(Method.java:491)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
   10-06 22:17:17.080: E/AndroidRuntime(25156):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
    10-06 22:17:17.080: E/AndroidRuntime(25156):    at dalvik.system.NativeStart.main(Native Method)

I am using this code as :- My webservice give number of object which have lat,long and showing on map as:-

MapController objmapcontroller;
    GeoPoint objgeopointp;
    double lat, lng;
    try {
        lat = Double.parseDouble(latitude);
        lng = Double.parseDouble(longitude);
    } catch (Exception e) {
        e.printStackTrace();
        lat = lng = 0;
    }
    objgeopointp = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));
    objmapcontroller = objmapView.getController();

    // ---Add a location marker---


    // create and add an OverlayItem to the MyItemizedOverlay list
    OverlayItem overlayitem = new OverlayItem(objgeopointp, title, snippet);
    itemizedoverlay.addOverlay(overlayitem);
    objmapcontroller.animateTo(objgeopointp);
    objmapcontroller.setZoom(16);
    // add the overlays to the map
    mapOverlays.add(itemizedoverlay);
    objmapView.invalidate();

And My overlay class is as in that class Ontap method whole class is as

private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();
private Context mContext;
private MapView objmapview;
private View popUp;

public BidNearItemizedOverlay(Drawable defaultMarker, Context ctx,MapView objmapview,View popUp) {
    super(boundCenterBottom(defaultMarker));
    mContext =ctx;
    this.objmapview=objmapview;
    this.popUp=popUp;
}

public void addOverlay(OverlayItem overlay) {
    mOverlays.add(overlay);
    populate();
}

public void clear() {
    mOverlays.clear();
    populate();
}

@Override
protected OverlayItem createItem(int i) {

    return mOverlays.get(i);
}

@Override
public int size() {
    Log.e("------size--",""+mOverlays.size());
    return mOverlays.size();
}

@Override
protected boolean onTap(int index) {
     OverlayItem item=getItem(index);
      GeoPoint geo=item.getPoint();
      MapView.LayoutParams mapParams = new MapView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, 
            ViewGroup.LayoutParams.WRAP_CONTENT,
            geo,
            MapView.LayoutParams.BOTTOM_CENTER);
     TextView objtxt = (TextView)popUp.findViewById(R.id.textup);
     TextView objtxt2 = (TextView)popUp.findViewById(R.id.text2);
     objtxt.setText(item.getTitle());
     objtxt2.setText(item.getSnippet());
     ImageView objimg = (ImageView)popUp.findViewById(R.id.bluebutton);
     ImageButton objbtn = (ImageButton)popUp.findViewById(R.id.closebutton);
     objbtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            System.out.println("aclosehjdfd");
        }
    });
     objimg.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            System.out.println("hohodshfsdh");
        }
    });
    objmapview.addView(popUp, mapParams);
    return true;
}

please anyone suggest me how I can achieve this goal 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-12T16:37:10+00:00Added an answer on June 12, 2026 at 4:37 pm

    It looks like the View popUp you are sending in to BidNearItemizedOverlay already has a parent. When you call addView(popUp, mapParams), you are trying to give it a second parent. This is not allowed. You must first detach it from its parent if you really want to use it. The easiest solution might be to create a new view based on the properties in popUp rather than use that actual view.

    Or try:

    ((ViewGroup)popUp.getParent()).removeView(popUp);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am showing place by using pin image on google map in android by
I'm in the middle of developing android app using google map. My question is
In my android application i have used the google map. I have using android
Here is my code to display the google map in my android emulator using
I am working on Google Map application in android, there is no error when
I'm developing a map application in Android. I'm using Google maps API to show
In my Top Half of the Android Screen, I am showing Google Map and
i am trying to run google map tutorial using following link http://mobiforge.com/developing/story/using-google-maps-android followed all
Is it possible to cache google map tiles for specific region in Android using
I am developed application with google map in android 2.2 version using eclipse in

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.