Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MobilecoreFull implements CustomEventInterstitial {
- private Activity c;
- private boolean Shown = false;
- private CustomEventInterstitialListener l;
- private static final String DEV_HASH = "";
- @Override
- public void destroy() {
- mHandler.removeCallbacks(myTask);
- }
- private Handler mHandler;
- private Runnable myTask = new Runnable() {
- @Override
- public void run() {
- if (!Shown && l != null) {
- Log.i("ASD", "MOBILECORE NO FILL");
- l.onFailedToReceiveAd();
- }
- }
- };
- @Override
- public void requestInterstitialAd(final CustomEventInterstitialListener l,
- Activity c, String arg2, String arg3, MediationAdRequest arg4,
- Object arg5) {
- this.c = c;
- this.l = l;
- Log.i("ASD", "MOBILECORE FULL");
- try {
- MobileCore.init(c, DEV_HASH, LOG_TYPE.PRODUCTION,
- AD_UNITS.INTERSTITIAL);
- MobileCore.setAdUnitEventListener(new AdUnitEventListener() {
- @Override
- public void onAdUnitEvent(AD_UNITS arg0, EVENT_TYPE e) {
- if (e == EVENT_TYPE.AD_UNIT_READY) {
- Log.i("ASD", "MOBILE CORE READY, SHOWING...");
- l.onReceivedAd();
- Shown = true;
- }
- }
- });
- mHandler = new Handler();
- mHandler.postDelayed(myTask, 4000);
- } catch (Exception e) {
- }
- }
- @Override
- public void showInterstitial() {
- try {
- MobileCore.showInterstitial(c, new CallbackResponse() {
- @Override
- public void onConfirmation(TYPE arg0) {
- }
- });
- } catch (Exception e) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement