Google maps v2 on android devices with minSDK below 11

前端 未结 3 1585
我寻月下人不归
我寻月下人不归 2021-01-16 09:51

i have problem with this line when I create project which use Google maps API v2.

GoogleMap map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-16 10:32

    Use SupportMapFragment from a FragmentActivity, instead of MapFragment from an Activity. To use fragments on devices older than API Level 11, you need to use the Android Support package's backport of fragments (where FragmentActivity comes from).

提交回复
热议问题