android - Show Google Maps V2 markers based on selected tab -
i'm using fragments
, viewpager
show 2 tabs inside app. there's map inside main activity:
<android.support.v4.view.viewpager android:id="@+id/pager" android:layout_width="fill_parent" android:layout_height="wrap_content" > </android.support.v4.view.viewpager> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.supportmapfragment" tools:layout="@layout/activity_map" />
i show different set of markers on map in each tab. first tab loading them local db , second 1 remote server. i've tried placing logic inside oncreateview
in fragment
both called when activity starts, not when 1 of them selected, markers aren't replaced on tab select. how should proceed?
Comments
Post a Comment