Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 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. interstitial = new SASInterstitialView(activity);
  10. //HandsMdmAds.getInstance().targetAdToAudience((SASInterstitialView) interstitialAdObject,
  11. HandsMdmAds.getInstance().targetAdToAudience(interstitial,
  12. "INTERSTITIAL", "ROS", new SASInterstitialView.AdResponseHandler()
  13. {
  14. @Override
  15. public void adLoadingCompleted(SASAdElement sasAdElement)
  16. {
  17. Log.d("myHands", "adLoadingCompleted: ");
  18. try
  19. {
  20. isReadyToShow = true;
  21. setResponseStatus(eAdsResponseStatus.succeed);
  22. onInterstitialAdLoaded();
  23. }
  24. catch (Exception e)
  25. {
  26. e.printStackTrace();
  27. }
  28. }
  29.  
  30. @Override
  31. public void adLoadingFailed(Exception e)
  32. {
  33. Log.d("myHands", "adLoadingFailed: " + _placment.name() + " " + e.getMessage());
  34. try
  35. {
  36. isReadyToShow = false;
  37. /*eAdsResponseStatus responseStatus = null;
  38. if (e == AdError.NO_FILL)
  39. {
  40. responseStatus = eAdsResponseStatus.no_fill;
  41. }
  42. else
  43. {
  44. responseStatus = eAdsResponseStatus.error;
  45. }
  46. setResponseStatus(responseStatus);*/
  47. responseStatus = eAdsResponseStatus.error;
  48. onInterstitialAdFailedToLoad();
  49. }
  50. catch (Exception e1)
  51. {
  52. e1.printStackTrace();
  53. }
  54. }
  55. });
  56. }
  57. }
  58. catch (Exception e)
  59. {
  60. e.printStackTrace();
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement