こんにちは、AdColony SDK を使用して複数の動画を順番に実行したいと考えています。つまり、1 つの動画が終了したら、別の動画を表示する必要があります。しかし、それを機能させることはできません。最初のビデオが終了すると、他のビデオは表示されません。これは私のコード、私の onCreate メソッドです:
@Override
public void onCreate( Bundle savedInstanceState )
{
super.onCreate(savedInstanceState);
getActionBar().hide();
// Configure ADC once early before any other ADC calls (except setCustomID/setDeviceID).
AdColony.configure( this, "1.0", APP_ID, ZONE_ID_ONE_VIDEO );
// version - arbitrary application version
// store - google or amazon
// Disable rotation if not on a tablet-sized device (note: not
// necessary to use AdColony).
if ( !AdColony.isTablet() )
{
setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_PORTRAIT );
}
// Notify this object about confirmed virtual currency.
AdColony.addV4VCListener( this );
// Notify this object about ad availability changes.
AdColony.addAdAvailabilityListener( this );
setContentView( R.layout.videos_ads_activity );
mAppPreferences = new AppPreferences(this);
/*video1 = new AdColonyV4VCAd(WatchVideosActivity.ZONE_ID_ONE_VIDEO);
video2 = new AdColonyV4VCAd(WatchVideosActivity.ZONES_FIVES_VIDEOS[1]).withListener(this);
video3 = new AdColonyV4VCAd(WatchVideosActivity.ZONES_FIVES_VIDEOS[2]).withListener(this);
video4 = new AdColonyV4VCAd(WatchVideosActivity.ZONES_FIVES_VIDEOS[3]).withListener(this);
video5 = new AdColonyV4VCAd(WatchVideosActivity.ZONES_FIVES_VIDEOS[4]).withListener(this);*/
showOneVideo = (Button) findViewById(R.id.buttonShowOneVideo);
showOneVideo.setOnClickListener(
new View.OnClickListener()
{
public void onClick( View v )
{
AdColonyV4VCAd v4vc_ad = new AdColonyV4VCAd()
.withListener( WatchVideosActivity.this);
if(v4vc_ad.getAvailableViews() == 0){
Toast.makeText(WatchVideosActivity.this, "Loading ads", Toast.LENGTH_SHORT).show();
}else{
v4vc_ad.show();
}
}
});
showFiveVideos = (Button) findViewById(R.id.buttonShowFiveVideos);
showFiveVideos.setOnClickListener(
new View.OnClickListener()
{
public void onClick( View v )
{
v4vc_ad = new AdColonyV4VCAd(ZONE_ID_ONE_VIDEO)
.withListener( WatchVideosActivity.this);
if(v4vc_ad.getAvailableViews() == 0){
Toast.makeText(WatchVideosActivity.this, "Loading ads", Toast.LENGTH_SHORT).show();
}else{
v4vc_ad.show();
}
}
});
}
私のクラスの残りの部分(インスタンス変数は入れていませんが、宣言されています):
public void onPause()
{
super.onPause();
AdColony.pause();
}
public void onResume()
{
super.onResume();
AdColony.resume( this );
}
// Reward Callback
public void onAdColonyV4VCReward( AdColonyV4VCReward reward )
{
if (reward.success())
{
//Guardamos el reward en mi preference
mAppPreferences.setCoins(mAppPreferences.getCoins() + reward.amount());
Log.d("AdColony", "rewaerdCallback listener");
}
}
// Ad Started Callback - called only when an ad successfully starts playing
public void onAdColonyAdStarted( AdColonyAd ad )
{
Log.d("AdColony", "onAdColonyAdStarted");
}
//Ad Attempt Finished Callback - called at the end of any ad attempt - successful or not.
public void onAdColonyAdAttemptFinished( AdColonyAd ad )
{
try {
Thread.sleep(1500);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
AdColonyV4VCAd v4vc_ad = new AdColonyV4VCAd()
.withListener( WatchVideosActivity.this);
v4vc_ad.show();
}
}
onAdColonyAdAttemptFinished コールバックで新しい動画を作成しましたが、表示されません。助けてください。前もって感謝します。