1

I'm new in Android.I'm doing a project on Multicasting.Now I need a bubble to display in map when tapped on the Marker. I don't need the Dialog box,need a bubble view with a button and a textview.Want to display the textview first.Don't know what I do with this code.Tried so many times.But not getting any idea.This is my onTap code:

            protected boolean onTap(int index)
             {
    System.out.println("Tapped");

    //To display the bubble for robots:
    //LayoutInflater inflater = this.getLayoutInflater();
  //bubble_view = (LinearLayout) inflater.inflate(R.layout.window_view, bubble_view );

 TextView venueName = (TextView) bubble_view.findViewById(R.id.name1);
    venueName.setText("Hello SK");

   GeoPoint rPoint = null;
MapView.LayoutParams params = new MapView.LayoutParams(
        LayoutParams.WRAP_CONTENT, 200,
            rPoint, MapView.LayoutParams.BOTTOM_CENTER);

            bubble_view.setLayoutParams(params);
             System.out.println("sgdhgsetlumstmwejfsd");
     map.addView(bubble_view);

                    Runnable r = new Runnable() {
            public void run() {

                bubble_view.setVisibility(View.VISIBLE);    
                 }
        };
            //Projection projection = ((MapView) map).getProjection();
        //Point p = new Point();

        //projection.toPixels(rPoint, p);
        //p.offset(0, -(bubble_view.getMeasuredHeight() / 2));
        //GeoPoint target = projection.fromPixels(p.x, p.y);

        //mapController = ((MapView) map).getController(); 
        //mapController.setZoom(16);


        //mapController.animateTo(target, r);

    //Toast.makeText( mContext,"Device Name: "+index,Toast.LENGTH_SHORT).show(); 
    //return bubble_view != null;
    return true;
}



private LayoutInflater getLayoutInflater() {
    // TODO Auto-generated method stub
    return null;
}
   }

Here is my code.It is with errors.Is LayoutInflator define only in the onCreate.Most part of the code i referred inn this site:http://www.actionshrimp.com/tag/android-2/

please help me to make it correct.

mary victoria
  • 21
  • 1
  • 7

1 Answers1

1

You can use the mapviewballoons library to do this.

aromero
  • 25,681
  • 6
  • 57
  • 79