atom2ueki
atom2ueki

Reputation: 835

Android: onInfoWindowClick never called

I've implemented onInfoWindowClick through Android Google Maps v2.

public class myMap extends Activity implements GoogleMap.OnInfoWindowClickListener
{
    @Override
    public void onInfoWindowClick(Marker marker) {
        System.out.println("111");
        final String ssid = marker.getTitle();  

        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        LayoutInflater inflater = this.getLayoutInflater();
        builder.setView(inflater.inflate(R.layout.dialog_signin, null))
        .setTitle("Network Connection")            
        .setMessage("Connect to"+ssid)
        .setCancelable(false)
        .setPositiveButton("Connect",new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog,int id) {
                wificonnector(ssid);
            }
        })
        .setNegativeButton("Cancel",new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog,int id) {
                dialog.cancel();
            }
        })
        .show();
    }
}

When I click infowindows of the marker (click marker first then click that label), it totally doesn't respond.

Upvotes: 1

Views: 1229

Answers (1)

nedaRM
nedaRM

Reputation: 1827

Make sure you set this listener on the map GoogleMap.setInfoWindowAdapter(this)

Upvotes: 1

Related Questions