google map not working on both emulator and device

前端 未结 3 1775
自闭症患者
自闭症患者 2020-12-20 07:33

I am trying to run a simple google map but its not working its showing only map background.checked on both emulator and device.

xml file:-



        
3条回答
  •  渐次进展
    2020-12-20 07:38

    In your manifest file you have to add:

    
    

    Like from: your.application.package to: com.themontcalm.droid

    And yes if you are using

    
    

    then remove from manifest file:

    and add your api code to in manifest file also:

    
    

    And in manifest file you are missing this:

    
    

    so also add to this also in manifest file:

    you should change android.R.id.content with R.id.map in your code

    Something like:

    map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
    

提交回复
热议问题