如何在 Android MapView 中从 Pin/Marker 打开一个新的 Activity?
像这样,然后我想点击一个标记,它应该打开一个新活动,我该怎么做?
我的代码:
private GeoPoint getPoint(double lat, double lon) {
return(new GeoPoint((int)(lat*1000000.0),
(int)(lon*1000000.0)));
}
私有类 SitesOverlay 扩展 ItemizedOverlay { private List items=new ArrayList();
public SitesOverlay(Drawable marker) {
super(marker);
boundCenterBottom(marker);
items.add(new OverlayItem(getPoint(47.17612,
8.499727),
"TCS", "TCS Camping Brüggli"));
items.add(new OverlayItem(getPoint(47.57612,
8.499727),
"",
""));
items.add(new OverlayItem(getPoint(00.765136435316755,
00.97989511489868),
"",
""));
items.add(new OverlayItem(getPoint(00.0686417491799,
00.01572942733765),
"",
""));
populate();
}
@Override
protected OverlayItem createItem(int i) {
return(items.get(i));
}
@Override
protected final boolean onTap(int i) {
//Do you job here.
startActivity(new Intent(MaptestActivity.this,SettingsActivity.class));
return false;