So because I try to monetize game it's a bit more difficult since there is no "public void onCreate
" method in java class in which I need to call ads. Adding a banner is no issue for me but it's interstitial ads I can't call. In my main java class I created a method:
public void showInter(){
startAppAd.showAd();
startAppAd.loadAd();
}
So in other class I made "MainClass example = new MainClass();
" and when game ends I call "example.showInter()
" but ads don't show. Anyone has idea for solution? I can't create StartAppAd
object in this class in the normal way at least.
答案 0 :(得分:0)
在使用之前是否初始化了startAppAd?
private StartAppAd startAppAd = new StartAppAd(this);
您还可以使用AdEventListener获取用于加载广告的回调并检查广告失败的原因: https://github.com/StartApp-SDK/Documentation/wiki/android-advanced-usage#adding-a-callback-when-an-interstitial-ad-is-loaded