Java 类com.google.android.gms.ads.doubleclick.AppEventListener 实例源码

项目:android-ads    文件:DFPAppEventsFragment.java   
@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);
}
项目:googleads-mobile-android-examples    文件:DFPAppEventsFragment.java   
@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);
}
项目:FMTech    文件:zzj.java   
public zzj(AppEventListener paramAppEventListener)
{
  this.zzuG = paramAppEventListener;
}
项目:QuizUpWinner    文件:z.java   
public z(AppEventListener paramAppEventListener)
{
  this.eI = paramAppEventListener;
}
项目:QuizUpWinner    文件:ah.java   
public final AppEventListener getAppEventListener()
{
  return this.eI;
}
项目:QuizUpWinner    文件:ag.java   
public final AppEventListener getAppEventListener()
{
  return this.eI;
}