Google Map V2 android map referencing

后端 未结 2 1462
终归单人心
终归单人心 2021-01-24 08:21

I\'m trying to setup google map for android. I\'m seeing the two zoom buttons but no map is getting displayed. I\'ve been struggling hard for last 6-7 hours. Earlier it was show

2条回答
  •  孤城傲影
    2021-01-24 08:29

    Acrivity have to extends FragmentActivity for proper fragment inflating. Please, check if MainActivity extends FragmentActivity. Remember that if you write app for older versions of Android you have to use support library v4 and SupportMapFragment instead of MapFragment.

    Btw. referencing android library in eclipse doesn't change AndroidManifest.xml, only project.properties. You have to add manually lines like this

    
    

    only if you use some Activity from library. In case of google maps v2 you only need MapFragment so you don't have to do that.

提交回复
热议问题