java - How to add a view to a specifc point on mapView -


an when ontouch event occurs on mapview, want layout have specified drawn above user has touched

the below have started, not know how place popup view on x , y values retrieved event. guys have ideas?

@override public boolean ontouchevent(motionevent ev, mapview mapview) {  int x = (int)ev.getx();           int y = (int)ev.gety();  viewgroup parent=(viewgroup)map.getparent(); view popup=getlayoutinflater().inflate(r.id.popup, parent, false);  ((viewgroup)map.getparent()).addview(popup); 

you can set mapview.layoutparams() values of x , y , call mapview's addview layoutparams.

mapview.layoutparams params = new mapview.layoutparams(width, height, x, y, alignment); mapview.addview(popup, params); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -