Hey everyone. I've implemented an ad banner in onCreate() as follows:
adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
adView = new AdView(this);
adView.setAdSize(AdSize.SMART_BANNER);
adView.setAdUnitId(getResources().getString(R.string.bottom_banner));
adView.loadAd(adRequest);
and in onDestroy():
adView.destroy();
Everything works. The problem is when I close the app and reopen it. The activity instance from before remains and a second activity is created, thus causing a memory leak. Looking at the hprof dump file, it looks like L10nUtils and WebView are keeping references of the activity. I believe that some component callbacks need to be unregistered in admob as the majority of the references are located there. Are there any solutions out there for this? Below is an image of the dump after closing and opening the app about 12 times.