App getting restart on resume-Vungle

201 Views Asked by At

When I tap on download button on Vungle ad it take to store, later when I try to open my app, it is getting restart, though I've not done this. According to me when you open browser, itunes etc from an app, the app should go into suspend mode & when coming back on app it should resume from the point where am leaving it, but my app is getting restarted.

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

1

There are 1 best solutions below

0
On

Use EventListener to do what you want then finish

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