Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. @Override
  2. public void LoadOperation(iAdLoadResult resultListener, Activity activity)
  3. {
  4. try
  5. {
  6. activityRef = new WeakReference<>(activity);
  7. if (HandsMdmAds.getInstance().isInitialized())
  8. {
  9. interstitialAdObject = new SASInterstitialView(activity);
  10. HandsMdmAds.getInstance().targetAdToAudience((SASInterstitialView) interstitialAdObject,
  11. "INTERSTITIAL", "ROS", new SASAdView.AdResponseHandler()
  12. {
  13. @Override
  14. public void adLoadingCompleted(SASAdElement sasAdElement)
  15. {
  16. try
  17. {
  18. isReadyToShow = true;
  19. setResponseStatus(eAdsResponseStatus.succeed);
  20. onInterstitialAdLoaded();
  21. }
  22. catch (Exception e)
  23. {
  24. e.printStackTrace();
  25. }
  26. }
  27.  
  28. @Override
  29. public void adLoadingFailed(Exception e)
  30. {
  31. try
  32. {
  33. isReadyToShow = false;
  34. /*eAdsResponseStatus responseStatus = null;
  35. if (e == AdError.NO_FILL)
  36. {
  37. responseStatus = eAdsResponseStatus.no_fill;
  38. }
  39. else
  40. {
  41. responseStatus = eAdsResponseStatus.error;
  42. }
  43. setResponseStatus(responseStatus);*/
  44. responseStatus = eAdsResponseStatus.error;
  45. onInterstitialAdFailedToLoad();
  46. }
  47. catch (Exception e1)
  48. {
  49. e1.printStackTrace();
  50. }
  51. }
  52. });
  53. }
  54. }
  55. catch (Exception e)
  56. {
  57. e.printStackTrace();
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement