public CustomEventBannerAdapter(MoPubView moPubView, String className, String classData) { mHandler = new Handler(); mMoPubView = moPubView; mContext = moPubView.getContext(); mLocalExtras = new HashMap<String, Object>(); mServerExtras = new HashMap<String, String>(); mTimeout = new Runnable() { @Override public void run() { Log.d("MoPub", "Third-party network timed out."); onBannerFailed(NETWORK_TIMEOUT); invalidate(); } }; Log.d("MoPub", "Attempting to invoke custom event: " + className); try { mCustomEventBanner = CustomEventBannerFactory.create(className); } catch (Exception exception) { Log.d("MoPub", "Couldn't locate or instantiate custom event: " + className + "."); mMoPubView.loadFailUrl(ADAPTER_NOT_FOUND); return; } // Attempt to load the JSON extras into mServerExtras. try { mServerExtras = Json.jsonStringToMap(classData); } catch (Exception exception) { Log.d("MoPub", "Failed to create Map from JSON: " + classData + exception.toString()); } mLocalExtras = mMoPubView.getLocalExtras(); if (mMoPubView.getLocation() != null) { mLocalExtras.put("location", mMoPubView.getLocation()); } if (mMoPubView.getAdViewController() != null) { mLocalExtras.put(AD_CONFIGURATION_KEY, mMoPubView.getAdViewController().getAdConfiguration()); } }