我在我的应用程序中运行Google Maps v2,但是当我完成一个带有Map片段的活动时,几分钟后我收到消息“遗憾的是地图应用已停止”
我使用MapFragment在活动中创建onCreate:
public void onCreate(Bundle savedInstanceState) {
super.onCreate()
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
provider = LocationManager.NETWORK_PROVIDER;
locationManager.requestLocationUpdates(provider, 0, 0,
MapPicture.this);
GooglePlayServicesUtil
.isGooglePlayServicesAvailable(getApplicationContext());
setContentView(R.layout.activity_map_picture);
setUpMapIfNeeded(); }