Я также пытался использовать ApplicationContext, но по какой-то причине он все равно протекает.
Нашел похожую публикацию о проблеме здесь. Утечка AdActivity в AdMob (SDK 7.0) для Android, но без ответа.
Также пытался установить для прослушивателя рекламы и объявления значение null в onDestroy(), но безуспешно и все равно утечка активности.
Мой код вызвал onCreate()
private void refreshInterstitial(){
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("AD_ID");
mInterstitialAd.loadAd(new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR).addTestDevice("877BCC97E130A0DC62B2E5770D854496").build());
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
mInterstitialAd.show();
}
@Override
public void onAdClosed() {
}
});
}
Отслеживание канарейных утечек
┬───
│ GC Root: Global variable in native code
│
├─ mx instance
│ Leaking: UNKNOWN
│ ↓ mx.a
│ ~
├─ com.google.android.gms.ads.internal.webview.w instance
│ Leaking: UNKNOWN
│ mContext instance of com.google.android.gms.ads.internal.webview.ay, not wrapping activity
│ View#mParent is null
│ View#mAttachInfo is null (view detached)
│ View.mWindowAttachCount = 1
│ ↓ w.a
│ ~
├─ com.google.android.gms.ads.internal.webview.aa instance
│ Leaking: YES (View detached and has parent)
│ mContext instance of com.google.android.gms.ads.internal.webview.ay, not wrapping activity
│ View#mParent is set
│ View#mAttachInfo is null (view detached)
│ View.mWindowAttachCount = 1
│ ↓ aa.mListenerInfo
├─ android.view.View$ListenerInfo instance
│ Leaking: YES (aa↑ is leaking)
│ ↓ View$ListenerInfo.mOnClickListener
├─ com.google.android.gms.ads.nonagon.ad.webview.f instance
│ Leaking: YES (aa↑ is leaking)
│ ↓ f.a
├─ com.google.android.gms.ads.nonagon.ad.webview.l instance
│ Leaking: YES (aa↑ is leaking)
│ ↓ l.e
├─ com.google.android.gms.ads.nonagon.ad.event.bs instance
│ Leaking: YES (aa↑ is leaking)
│ ↓ bs.a
├─ java.util.HashMap instance
│ Leaking: YES (aa↑ is leaking)
│ ↓ HashMap.table
├─ java.util.HashMap$Node[] array
│ Leaking: YES (aa↑ is leaking)
│ ↓ HashMap$Node[].[1]
├─ java.util.HashMap$Node instance
│ Leaking: YES (aa↑ is leaking)
│ ↓ HashMap$Node.key
├─ com.google.android.gms.ads.nonagon.shim.k instance
│ Leaking: YES (aa↑ is leaking)
│ ↓ k.a
├─ com.google.android.gms.ads.internal.client.ae instance
│ Leaking: YES (aa↑ is leaking)
│ ↓ ae.a
├─ com.google.android.gms.internal.ads.zzuc instance
│ Leaking: YES (aa↑ is leaking)
│ ↓ zzuc.zzcbw
├─ com.test.Activity$1 instance
│ Leaking: YES (aa↑ is leaking)
│ Anonymous subclass of com.google.android.gms.ads.AdListener
│ ↓ EqualizerActivity$1.this$0
╰→ com.test.Activity instance
Leaking: YES (ObjectWatcher was watching this because Activity received Activity#onDestroy() callback and Activity#mDestroyed is true)
key = 40a1eb8e-c9e6-4062-b5f7-053e642e812f
watchDurationMillis = 5288
retainedDurationMillis = 258
Подробнее здесь: https://stackoverflow.com/questions/603 ... emory-leak
Мое межстраничное объявление вызывает утечку памяти? ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как долго я могу удерживать загруженное межстраничное объявление перед его показом?
Anonymous » » в форуме JAVA - 0 Ответы
- 15 Просмотры
-
Последнее сообщение Anonymous
-