完成活动后地图崩溃 - android

时间:2013-03-21 11:53:52

标签: android google-maps maps

我在我的应用程序中运行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(); }

0 个答案:

没有答案