这是我为Google Map项目编写的代码。但它在getMapAsync()的第271行提示错误。if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMapAsync();
所以我试着用Jsonfile在地图上显示标记,但它们没有出现,我把它缩小到了线上它给了我错误
public class MainActivity extends FragmentActivity implements OnMapReadyCallbackMapFragment) getFragmentManager()
com.google.android.gms.maps.CameraUpdateFactory;import com.google.android.gms.maps.OnMapReadyCallbackcom.google.android.gms.maps.model.MarkerOptions;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallbackgoog
我正在尝试让一个映射片段在我的应用程序中工作,并且在尝试获取我的GoogleMap对象时继续得到一个错误。// Do a null check // Try to obtain the map from the SupportMapFragmentFragment mmm = getChildFragmentManager().findFragmentById(R.id.fragment_map2);
getMapAsync()是否打算在单独的线程上运行?我之所以这样问,是因为在我的应用程序中,当映射加载时,它似乎是在主线程上这样做的,因为在加载之前,所有的UI都是没有响应的。我做错什么了吗?下面的代码是我的SupportMapFragment子类。我将回调(onMapReadyCallback)的引用传递给该类,该回调是在我的主要活动中实现的。public c