0
我在我的应用程序下面的活动,在地图片段设置一个地理位置,但是当我点击我的测试它与下面的错误崩溃的活动:应用在活动轰然实现谷歌地图API
我查看了错误,但我无法理解它为什么崩溃,因为它指的是主要原因之一。
这是我打电话的代码在OnCreate()供参考:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map_gmit);
/*map = (MapView)findViewById(R.id.map);
map.setBuiltInZoomControls(true);*/
//code to add a map marker at GMIT geographic location
GoogleMap mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
mMap.addMarker(new MarkerOptions()
.position(new LatLng(53.271900177, -9.04889965057))
.title("GMIT Galway Location"));;
}