googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);不起作用

时间:2013-02-06 00:36:56

标签: android google-maps

我的代码运行良好,地图显示正确

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

应用程序停止运行,异常

0 个答案:

没有答案