Skip to content

Instantly share code, notes, and snippets.

@BernardoGO BernardoGO/onAdLoad.java
Last active Nov 2, 2016

Embed
What would you like to do?
AdMob Ad visible onLoad
//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;
//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
You can’t perform that action at this time.