【发布时间】:2014-09-18 06:39:24
【问题描述】:
我创建了一个名为“Pin”的标记,并试图在单击它的窗口时打开一个活动/类。 从我目前的情况来看,活动会打开,但是当点击任何标记的窗口时。
我想在点击标记 Pin 的窗口时打开它。
我想开的班级是“holyStone”。
private void holystone()
{
// TODO Auto-generated method stub
LatLng pos = new LatLng(52.972869, -9.427004);
Marker Pin = theMap.addMarker(new MarkerOptions()
.title("Holy Stone of Clonrichert")
.snippet("Holy Stone of Clonrichert has been upgraded to a class two relic by the Vatican.")
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN))
.position(pos)
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN))
);
// below displays the window...remove this!!!
//Pin.showInfoWindow();
Pin.isInfoWindowShown();
this.theMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
@Override
public void onInfoWindowClick(Marker Pin) {
Intent intent = new Intent(MainActivity.this, holyStone.class);
startActivity(intent);
}
});
任何建议都会很棒,感谢您的关注。
【问题讨论】:
-
你的描述不清楚,听起来有点矛盾。请说明活动窗口何时打开,何时不打开。
-
对不起,我主要是想在点击Marker Pin的InfoWindow时打开holyStone.class。
标签: java android google-maps google-maps-markers