在Android上驳回间质性DFP广告,应用程序崩溃 [英] When dismiss interstitial DFP ad on Android, the app crashes

查看:244
本文介绍了在Android上驳回间质性DFP广告,应用程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的间质性DFP(DFP广告)的广告在我的Andr​​oid应用程序。当我触摸交叉翻盘的应用程序,该应用程序自行关闭。

在code是OK的,因为它在另一个应用程序。有没有人有一个想法?

下面是code在清单:

 <活动
        机器人:名称=com.google.ads.AdActivity
        机器人:configChanges =键盘| keyboardHidden |方向|屏幕布置| uiMode |屏幕尺寸/>
 

在我想要的酒吧活动:

  ...延伸活动实现OnTouchListener,OnClickListener,OnErrorListener,AdListener,OnCompletionListener ...
 

和酒吧code:

 私人DfpInterstitialAd间质性;
间质性=新DfpInterstitialAd(这一点,THE_PUB_ code);
AdRequest adRequest =新AdRequest();
interstitial.loadAd(adRequest);
interstitial.setAdListener(本);
 

解决方案

我找到了解决办法

有没有在方法的完成() onUserLeaveHint ()

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);

解决方案

I found the solution

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

这篇关于在Android上驳回间质性DFP广告,应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆