1

当我点击 Vungle 广告上的下载按钮时,它需要存储,稍后当我尝试打开我的应用程序时,它正在重新启动,尽管我没有这样做。据我说,当您从应用程序打开浏览器、itunes 等时,应用程序应该进入挂起模式,当返回应用程序时,它应该从离开它的位置恢复,但我的应用程序正在重新启动。

http://forums.coronalabs.com/topic/50281-app-getting-restart-on-resume-vungle/

4

1 回答 1

0

使用 EventListener 做你想做的事然后完成

final VunglePub vunglePub = VunglePub.getInstance();

@Override
protected void onCreate (Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    vunglePub.init(this, APP_ID);
    vunglePub.setEventListener(vungleListener);
}

private final EventListener vungleListener = new EventListener() {

    @Override
    public void onVideoView(boolean isCompletedView, int watchedMillis, int videoDurationMillis) {
        // Called each time a video completes. isCompletedView is true if the video was not skipped.
    }

    @Override
    public void onAdStart() {
        // Called before playing an ad
    }

    @Override
    public void onAdEnd() {
        // Called when the user leaves the ad and control is returned to your application
    }

    @Override
    public void onCachedAdAvailable() {
        Log.i("vungle","cachedAdAvail");
    }  

    @Override
    public void onAdUnavailable(String arg0) {
        Log.i("vungle","Ad unavailable: "+arg0);
    }

};  

public void playVungleAd() {
    vunglePub.playAd();
}
于 2015-07-29T16:34:00.273 回答