Is it possible to implement the onLongClickListener method in the marker on the map?

3

I'm developing an application that works on Google Maps API v2.

I have already set the onClickListener() method to open a WindowManager to display the name of the point of interest and the address of that location.

Now I want you to click a Marker continuously to display a WindowManager different so that you can save this location as a favorite in a SQLite table.

Thanks in advance for all the help ...

    
asked by anonymous 27.08.2015 / 01:23

1 answer

0

I advise you to follow this path so that you can work on the possibilities:

1 - When creating a ** (addMarker) ** marker, immediately save latitude and longitude information to the database.

2 - Now below are situations in which you will need an update at that specific point you registered in the database and according to each event you perform the updates:

mapa.setOnMarkerDragListener(new OnMarkerDragListener() {

        @Override
        public void onMarkerDragStart(Marker marker) {
            // Primeiro contato

        }

        @Override
        public void onMarkerDragEnd(Marker marker) {
            // Fim contato

        }

        @Override
        public void onMarkerDrag(Marker marker) {
            // Contato contínuo

        }
    });
  

Now you might be wondering why do not find a possibility for onLongClickListener in a marker ? Well ... You do not have to wait for your client to give a second click on the marker to be able to save an information in the database, since your application has the objective of salavr locations and also it will prefer to move a marker by the map, than clicking on each map point after you miss a position or want to update that particular position.

Font

    
27.08.2015 / 02:21