When dismiss interstitial DFP ad on Android, the a

2019-09-07 15:35发布

I have a simple interstitial DFP (DoubleClick for Publishers) ad in my Android app. When I touch the cross to comeback to the app, the app closes itself.

The code is ok because it works in another app. Does anyone have an idea?

Here is the code in the manifest :

<activity 
        android:name="com.google.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize"/>

In the activity where I want the pub:

...extends Activity implements OnTouchListener, OnClickListener, OnErrorListener, AdListener, OnCompletionListener...

and the pub code:

private DfpInterstitialAd interstitial;
interstitial = new DfpInterstitialAd(this, "THE_PUB_CODE");
AdRequest adRequest = new AdRequest();
interstitial.loadAd(adRequest);
interstitial.setAdListener(this);

1条回答
唯我独甜
2楼-- · 2019-09-07 16:17

I found the solution

There was a finish() in the method onUserLeaveHint()

查看更多
登录 后发表回答