我的代码运行良好,地图显示正确
package com.jameselsey.mapme;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
public class MapMe extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SupportMapFragment fragment = new SupportMapFragment();
getSupportFragmentManager().beginTransaction()
.add(android.R.id.content, fragment).commit();
GoogleMap googleMap =fragment.getMap();
}
}
但是当我尝试添加此行
时googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
应用程序停止运行,异常