Back to project page android-cd-travis-example.
The source code is released under:
MIT License
If you think the Android project android-cd-travis-example listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ruenzuo.weatherapp.activities; // ww w. jav a 2s. c o m import android.os.Bundle; import android.view.View; import android.widget.FrameLayout; import com.google.ads.AdRequest; import com.google.ads.AdSize; import com.ruenzuo.weatherapp.R; import com.ruenzuo.weatherapp.base.CitiesBaseActivity; import com.google.ads.AdView; public class CitiesActivity extends CitiesBaseActivity { private AdView adView; private View mAdView; public View getAdView() { return mAdView; } public void setAdView(View adView) { this.mAdView = adView; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); adView = new AdView(this, AdSize.BANNER, "a14defa59f9a1e7"); FrameLayout layout = (FrameLayout)findViewById(R.id.frameLayout); layout.addView(adView); adView.loadAd(new AdRequest()); setAdView(adView); } @Override public void onDestroy() { if (adView != null) { adView.destroy(); } super.onDestroy(); } }