Created
July 7, 2015 14:39
-
-
Save tsiougkosn/3ac6e58f330487090e80 to your computer and use it in GitHub Desktop.
Avocarrot Interstitial Close Reason
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AvocarrotInterstitial interstitial = new AvocarrotInterstitial(this, "api key", "Placement key"); | |
interstitial.setSandbox(true); | |
interstitial.setLogger(true, "ALL"); | |
interstitial.setListener(new AvocarrotInterstitialListener() { | |
boolean isClicked = false; | |
@Override | |
public void onAdDisplayed() { | |
super.onAdDisplayed(); | |
isClicked = false; | |
} | |
@Override | |
public void onAdClicked() { | |
super.onAdClicked(); | |
isClicked = true; | |
} | |
@Override | |
public void onAdDismissed() { | |
super.onAdDismissed(); | |
if (isClicked) { | |
Toast.makeText(MainActivity.this, "Closing because : Click the ad", Toast.LENGTH_SHORT).show(); | |
} else { | |
Toast.makeText(MainActivity.this, "Closing because : Click x OR back btn", Toast.LENGTH_SHORT).show(); | |
} | |
} | |
}); | |
interstitial.loadAndShowAd(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment