MapActivity in TabHost Fragment disappearing after tab switch

前端 未结 2 1497
忘掉有多难
忘掉有多难 2021-02-10 03:24

I\'m trying to display a map in a set of tabs, using fragments. The problem I\'m having is the map activity disappears if the user navigates to another fragment, then back. How

2条回答
  •  忘掉有多难
    2021-02-10 03:33

    If you used ViewPager in your project, call setOffscreenPageLimit() for it like shown below :

    this.mViewPager.setOffscreenPageLimit(fragments.size());

    where fragments is the Vector of fragments you've created

提交回复
热议问题