The interstitial ad is not being shown...
I have the play_services_lib included in the project and there are no errors.
The following code is in my Activity:
import com.google.android.gms.ads.*;
import com.google.android.gms.ads.AdRequest;
onCreate(){
// Create the interstitial.
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId("ca-app-pub-...");
// Create ad request.
AdRequest adRequest = new AdRequest.Builder().build();
// Begin loading your interstitial.
interstitial.loadAd(adRequest);
interstitial.setAdListener(new AdListener(){
public void onAdLoaded(){
displayInterstitial();
}
});
}
// Invoke displayInterstitial() when you are ready to display an interstitial.
public void displayInterstitial() {
if (interstitial.isLoaded()) {
interstitial.show();
}
}
Manifest.xml
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@@android:style/Theme.Holo.NoActionBar.Fullscreen" >
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Do I still need the following(It is from where I used the old admob sdk)
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<meta-data
android:name="ADMOB_PUBLISHER_ID"
android:value="pub-..." />