【问题标题】:how to show amazon interstitials when app starts (android)如何在应用启动时显示亚马逊插页式广告(android)
【发布时间】:2014-07-20 18:01:51
【问题描述】:
我想知道如何在应用在 Android 设备上启动时立即显示亚马逊插页式广告。
我试过了……
AdRegistration.setAppKey(APP_KEY);
this.interstitialAd = new InterstitialAd(this);
this.interstitialAd.loadAd();
this.interstitialAd.setListener(this);
在 OnCreate 下,但广告不会出现
【问题讨论】:
标签:
java
android
ads
amazon-appstore
【解决方案1】:
通过在清单中将其声明为启动器来创建启动器活动,以显示您的兴趣
制作一个处理程序并使用 postdelayed 开始您的主要活动
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
// do not set contentView
Your Interestial logic goes here
//set up a handler to start main activity
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(Splash.this,HomeActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
}, 4000);
}