public class AdActivity extends ActionBarActivity {
PublisherAdView adView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ad_example);
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.linLayout);
adView = new PublisherAdView(this);
adView.setAdSizes(AdSize.SMART_BANNER);
adView.setAdUnitId("/6499/example/banner");adView.loadAd(new PublisherAdRequest.Builder().build());linearLayout.addView(adView);
}
@Override
protected void onResume() {
adView.resume();
super.onResume();
}
@Override
protected void onPause() {
adView.pause();
super.onPause();
}
@Override
protected void onStop() {
adView.destroy();
super.onStop();
}
}After rotating the device multiple times, or entering and exiting the activity (from another activity), I manually cause GC to make sure the references should be cleared. When I open up a heap dump, I see multiple AdActivity objects.
If I do not actually load an ad, adView.loadAd(...), I don't see any leaks. Am I missing something?
--
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/DnICRC67ASI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
com.google.android.gms:play-services-ads:10.0.1