1

我已经通过 Android Google Maps v2 实现了 onInfoWindowClick。

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();
    }
}

当我单击标记的信息窗口(先单击标记然后单击该标签)时,它完全没有响应。

4

1 回答 1

1

确保你在地图上设置了这个监听器GoogleMap.setInfoWindowAdapter(this)

于 2013-09-24T01:13:51.137 回答