Skip to main content
adicionou 1564 caracteres ao conteúdo
Fonte Link
Marco Giovanni
  • 2,8mil
  • 2
  • 17
  • 33

[EDIT]

Tente isto

private class MapaGet ... {
  
  
  //...
  //seu codigo
  //
  
   @Override
    protected void onPostExecute(Void result) {
      //...
      //...
      int id = 0;
      mMap.setOnInfoWindowClickListener(new MyOnInfoWindowClickListener(id, mc));
    }

    public class MyOnInfoWindowClickListener extends GoogleMap.OnInfoWindowClickListener {

        private int mParametro = 0;
        private MapasController mMapasController = null;

        public MyOnInfoWindowClickListener(int parametro, MapasController mapasController) {
            this.mParametro = parametro;
            this.mMapasController = mapasController;
        }

        @Override
        public void onInfoWindowClick(Marker marker) {
           //implementar o método, pode usar o mParametro aqui dentro

           MapasController mc = mMapasController;
           Intent in = new Intent(ViewMaps.this, DescricaoMaps.class);

              in.putExtra(TAG_ID, mc.getId());
              in.putExtra(TAG_TITULO, mc.getTitulo());
              in.putExtra(TAG_DESCRICAO, mc.getDescricao());
              in.putExtra(TAG_DATA, mc.getData());
              in.putExtra(TAG_STATUS, mc.getStatus());
              in.putExtra(TAG_USUARIO, mc.getUsuario());
              in.putExtra(TAG_CATEGORIA, mc.getCategoria());

        }

    }
}

[EDIT]

Tente isto

private class MapaGet ... {
  
  
  //...
  //seu codigo
  //
  
   @Override
    protected void onPostExecute(Void result) {
      //...
      //...
      int id = 0;
      mMap.setOnInfoWindowClickListener(new MyOnInfoWindowClickListener(id, mc));
    }

    public class MyOnInfoWindowClickListener extends GoogleMap.OnInfoWindowClickListener {

        private int mParametro = 0;
        private MapasController mMapasController = null;

        public MyOnInfoWindowClickListener(int parametro, MapasController mapasController) {
            this.mParametro = parametro;
            this.mMapasController = mapasController;
        }

        @Override
        public void onInfoWindowClick(Marker marker) {
           //implementar o método, pode usar o mParametro aqui dentro

           MapasController mc = mMapasController;
           Intent in = new Intent(ViewMaps.this, DescricaoMaps.class);

              in.putExtra(TAG_ID, mc.getId());
              in.putExtra(TAG_TITULO, mc.getTitulo());
              in.putExtra(TAG_DESCRICAO, mc.getDescricao());
              in.putExtra(TAG_DATA, mc.getData());
              in.putExtra(TAG_STATUS, mc.getStatus());
              in.putExtra(TAG_USUARIO, mc.getUsuario());
              in.putExtra(TAG_CATEGORIA, mc.getCategoria());

        }

    }
}
Fonte Link
Marco Giovanni
  • 2,8mil
  • 2
  • 17
  • 33

Crie uma classe que extenda GoogleMap.OnInfoWindowClickListener

por exemplo

public class MyOnInfoWindowClickListener extends GoogleMap.OnInfoWindowClickListener {

    private int mParametro = 0;

    public MyOnInfoWindowClickListener(int parametro) {
        this.mParametro = parametro;
    }

    @Override
    public void onInfoWindowClick(Marker marker) {
       //implementar o método, pode usar o mParametro aqui dentro

    }
}

e no setOnInfoWindowClickListener, basta criar uma instancia da classe

int id = 3;
mMap.setOnInfoWindowClickListener(new MyOnInfoWindowClickListener(id))

espero ter ajudado!