Closed GoogleCodeExporter closed 9 years ago
In your CustomInfoWindow constructor, add this:
((Activity) mapView.getContext()).registerForContextMenu(mView);
mView.setOnTouchListener(new View.OnTouchListener() {
@Override public boolean onTouch(View v, MotionEvent e) {
if (e.getAction() == MotionEvent.ACTION_UP){
openContextMenu(mView);
}
return true;
}
});
Then implement onCreateContextMenu in your Activity, inflating your menu.
Then implement onContextItemSelected in your Activity, inflating your menu, to
perform the actions you want.
It should work...
Original comment by mathieu....@gmail.com
on 7 Jan 2014 at 1:02
Thank you for helping.
Calling the openContextMenu ... is the CustomInfoWindow put in your example as
an claas within your activity?
An example would greatly help.
Original comment by janvdijs...@gmail.com
on 10 Jan 2014 at 8:00
Effectively, the CustomInfoWindow in my example was an inside class in my
activity.
Just write:
((Activity) mapView.getContext()).openContextMenu(mView);
if it's an independant class.
Original comment by mathieu....@gmail.com
on 11 Jan 2014 at 2:17
Original comment by mathieu....@gmail.com
on 17 Jan 2014 at 5:58
Thank you. I will experiment with it!
Original comment by janvdijs...@gmail.com
on 18 Jan 2014 at 3:59
Original issue reported on code.google.com by
janvdijs...@gmail.com
on 4 Jan 2014 at 7:47