@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mAdView = getView().findViewById(R.id.appevents_av_main); mAdView.setAppEventListener(new AppEventListener() { @Override public void onAppEvent(String name, String data) { // The DFP ad that this fragment loads contains JavaScript code that sends App // Events to the host application. This AppEventListener receives those events, // and sets the background of the fragment to match the data that comes in. // The ad will send "red" when it loads, "blue" five seconds later, and "green" // if the user taps the ad. // This is just a demonstration, of course. Your apps can do much more interesting // things with App Events. if (name.equals("color")) { switch (data) { case "blue": mRootView.setBackgroundColor(Color.rgb(0xD0, 0xD0, 0xFF)); break; case "red": mRootView.setBackgroundColor(Color.rgb(0xFF, 0xD0, 0xD0)); break; case "green": mRootView.setBackgroundColor(Color.rgb(0xD0, 0xFF, 0xD0)); break; } } } }); PublisherAdRequest adRequest = new PublisherAdRequest.Builder().build(); mAdView.loadAd(adRequest); }
public zzj(AppEventListener paramAppEventListener) { this.zzuG = paramAppEventListener; }
public z(AppEventListener paramAppEventListener) { this.eI = paramAppEventListener; }
public final AppEventListener getAppEventListener() { return this.eI; }