xcxm0304 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Create context menu at long press in MapView (or Overlay) #508

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
How can I create and use a contextMenu on a longpress on a MapView? 

I can detect a long-press in an Overlay, but how can I create the ContextMenu? 

    @Override 
    public boolean onLongPress(MotionEvent e, MapView mapView) {
        System.out.println( "Detected long press ... yes, this works!"); 
        MenuInflater inflater3 = ?via an activity?.getMenuInflater();
        inflater3.inflate( R.menu.wp_list_contextmenu, ?what to enter here?);
        return true;
    }

Expected output: long press on the MapView giving a contextMenu. E.g. to create 
a new waypoint / coordinate,. 

I use the newest version of osmdroid. 

Original issue reported on code.google.com by janvdijs...@gmail.com on 4 Jan 2014 at 1:29

GoogleCodeExporter commented 9 years ago
Sorry, this is not an osmdroid-specific question (it is general Android) and is 
not a bug. You would probably be better off asking on StackOverflow.

Original comment by kurtzm...@gmail.com on 7 Jan 2014 at 3:03