InterstitialActivity
callback: loadInterstitial
Disable button
Set text to “Loading Interstitial”
Property: mShowButton
callback: showInterstitial (empty)
set to disable in onCreate
interstitial_ad_unit_id
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearLayout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/loadButton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Load Interstitial" android:onClick="loadInterstitial"/> <Button android:id="@+id/showButton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Interstitial Not Ready" android:onClick="showInterstitial" /> </LinearLayout>
public class InterstitialActivity extends Activity {
private Button mShowButton;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_interstitial);
mShowButton = (Button) findViewById(R.id.showButton);
mShowButton.setEnabled(false);
}
public void loadInterstitial(View unusedView){
mShowButton.setEnabled(false);
mShowButton.setText("Loading Interstitial");
}
public void showInterstitial(view unusedView){
}
}