Should I use MapView or MapFragment

前端 未结 2 616
失恋的感觉
失恋的感觉 2020-12-04 18:00

I am not sure whether I should be using MapView or stick to using a MapFragment. My application is an app that finds the nearest set of places that

2条回答
  •  天命终不由人
    2020-12-04 18:28

    MapFragment

    • Use it if you want to add a map into Activity class (not fragment because it will create a nested fragment and it´s a mess).
    • Use SupportMapFragment if you want to support just android versions lower than v12.

    MapView

    • Use it if you are going to add a map into a fragment. (you need to update each lifecicle to MapView).

提交回复
热议问题