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