How to use google map V2 inside fragment?

后端 未结 9 848
攒了一身酷
攒了一身酷 2020-12-02 13:43

I have a fragment which is a part of Viewpager, and I want to use Google Map V2 inside that fragment. This is what I have tried so far,

In my fragment,



        
9条回答
  •  春和景丽
    2020-12-02 14:07

    I had more or less the same problem. I had a Navigation Drawer and I wanted to put the map in a fragment.

    I followed this thread (but it is in Spanish): https://groups.google.com/forum/#!msg/desarrolladores-android/1cvqPm0EZZU/Q801Yvb2ntYJ

    The clue was (in my opinion) to change the layout.xml file: Instead of a "fragment" inside your "layout subfragment_info.xml" you would need to change to this:

    `
    

    Here it is the code inside the thread (you could use it and adapt): https://groups.google.com/d/msg/desarrolladores-android/1cvqPm0EZZU/9srw_9feamUJ

提交回复
热议问题