android map in fragment

后端 未结 1 351
时光说笑
时光说笑 2021-01-14 07:53

I am trying to create a android app that has one activity and multiple fragments. Each fragment will ocupy the entire screen when it is in view and with a replace transacti

相关标签:
1条回答
  • 2021-01-14 08:31

    The problem is that I was trying to change the map element before it was displayed setUpMapIfNeeded() is called in onCreate() (the view is inflated only in onCreateView()).

    If I move the call setUpMapIfNeeded() in onResume() everything works because then the view is inflated and it can use the map and modify it.

    This is where I found the answer

    0 讨论(0)
提交回复
热议问题