Last active
November 2, 2016 15:23
-
-
Save BernardoGO/66038754a8ffbe365cf96b34afef9880 to your computer and use it in GitHub Desktop.
AdMob Ad visible onLoad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add the following imports to the activity code | |
import com.google.android.gms.ads.AdListener; | |
import com.google.android.gms.ads.AdRequest; | |
import com.google.android.gms.ads.AdView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add to the onCreate method | |
final AdView mAdView = (AdView) findViewById(R.id.adView); ///AD ID | |
AdRequest adRequest = new AdRequest.Builder().build(); | |
mAdView.loadAd(adRequest); | |
mAdView.setAdListener(new AdListener() { | |
@Override | |
public void onAdLoaded() { | |
mAdView.setVisibility(View.VISIBLE); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment