每次活动被销毁时,我的应用程序都会泄漏其中一个活动的根布局。将最短路径合并到GC根目录只显示每个泄漏实例的一个根,并且路径是所有Google Maps API类:
com.google.android.gms.location.internal.t @ 0x42387220 Native Stack
'- a com.google.android.gms.location.internal.s @ 0x42387268
'- a com.google.maps.api.android.lib6.d.v @ 0x425f73a0
'- c com.google.maps.api.android.lib6.d.aj @ 0x4261f5d8
'- i com.google.maps.api.android.lib6.gmm6.c.a @ 0x425fbbf0
'- d com.google.maps.api.android.lib6.gmm6.c.y @ 0x42754cd0
'- mParent android.widget.FrameLayout @ 0x4261f678
'- mParent android.widget.FrameLayout @ 0x4245c6c0
'- mParent android.widget.RelativeLayout @ 0x4254ca08
我没有在任何地方使用FrameLayout
,所以我认为这是MapFragment
用户界面的一部分。
我可能做些什么来引起这种情况?除了调用setMyLocationEnabled(true)
之外,该活动不会对地图执行任何操作。我没有创造任何标记或任何东西。
这是在活动XML中声明片段的方式:
<fragment
android:name="com.google.android.gms.maps.MapFragment"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/fake_status_bar"
android:layout_toRightOf="@id/leftButtons"
android:layout_margin="3dp" />
我正在使用google-play-services_lib第26版,这是最新版本。
修改:这是known issue。