title: Can't see ads, but log says ad finished loading
body: <p>I have the below code. I can't see any ads, but in the log messages I can see the ad has finished loading.</p>
  
  <p>All I am doing is reading a <code>json</code> and displaying the data. I don't have anything in the layout xml, and I am creating all the view elements dynamically....</p>
  
  <pre><code>package com.ark.itilfoundation;
  
  import java.io.*;
  import java.util.Random;
  import org.json.*;
  import android.app.Activity;
  import android.content.Intent;
  import android.content.SharedPreferences;
  import android.graphics.Color;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.*;
  import android.view.View.OnClickListener;
  import android.view.ViewGroup.LayoutParams;
  import android.widget.*;
  
  import com.google.android.gms.ads.*;
  /**
   * @author Sravan Alaparthi
   */
  public class Questionare extends Activity {
  
      JSONArray jArray;
      int navigator=0;
      RelativeLayout layout;
      private static InterstitialAd interstitial;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          SharedPreferences sharedPreferences = this.getSharedPreferences("com.ark.itilfoundation", MODE_PRIVATE);
          layout = new RelativeLayout(this);      
  
          // Create the interstitial.
          interstitial = new InterstitialAd(this);
  
          interstitial.setAdUnitId("ca-app-pub-5273873598316367/6682193940");
  
          // Create ad request.
          AdRequest adRequest = new AdRequest.Builder()
          .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)       // Emulator
          .addTestDevice("AEA7763360CC914D4A30F78D9553511B") // My Galaxy Nexus test phone
          .build(); 
  
          interstitial.setAdListener(new AdListener() {});
  
          // Begin loading your interstitial.
          interstitial.loadAd(adRequest);
  
          // Invoke displayInterstitial() when you are ready to display an interstitial.
          displayInterstitial();
  
          //Get Data From Text Resource File Contains Json Data.    
          InputStream inputStream = getResources().openRawResource(R.raw.questions);
          ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
  
          int ctr;
          try {
              ctr = inputStream.read();
              while (ctr != -1) {
                  byteArrayOutputStream.write(ctr);
                  ctr = inputStream.read();
              }
              inputStream.close();
          }
          catch (IOException e) {
              e.printStackTrace();
          }
          Log.v("Text Data", byteArrayOutputStream.toString());
          try {
              // Parse the data into json object to get original data in form of json.
              JSONObject jObject =
                      new JSONObject(byteArrayOutputStream.toString());
              JSONObject jObjectResult = jObject.getJSONObject("Questions");
              jArray = jObjectResult.getJSONArray("Question");
  
              layoutcreator(navigator,sharedPreferences);
              //  ArrayList&lt;String[]&gt; data = new ArrayList&lt;String[]&gt;();
  
          }
          catch (Exception e) {
              e.printStackTrace();
          }
  
      }
  
      public static void displayInterstitial() {
          if (interstitial.isLoaded())
                interstitial.show();
      }
  
      public void layoutcreator(int i,SharedPreferences sharedPreferences){
          try {
              TextView tv1 = new TextView(this);          
              tv1.setText(jArray.getJSONObject(i).getString("Q"));
              tv1.setId(12);
              RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
                  LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
              lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
              layout.addView(tv1,lp);             
  
              final SharedPreferences sharedPreference = sharedPreferences;
              final int x =i+1;
              final int y =i-1;
              Button nextbt = new Button(this);
              if(i&gt;=0 &amp; i&lt;59){
                  nextbt.setText("Next");                
                  nextbt.setId(123);
  
                  nextbt.setOnClickListener(new OnClickListener() {
  
                      @Override
                      public void onClick(View v) {
                          layout.removeAllViews();
                          layoutcreator(x,sharedPreference);
                      }
                  });
  
                  RelativeLayout.LayoutParams n = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
                  n.addRule(RelativeLayout.BELOW,tv1.getId());
                  n.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
                  layout.addView(nextbt, n);
              }
              if(i&gt;=1 &amp; i&lt;=59){
                  Button prevbt = new Button(this);
                  prevbt.setText("Prev");                    
  
                  prevbt.setOnClickListener(new OnClickListener() {
  
                      @Override
                      public void onClick(View v) {
                          layout.removeAllViews();    
                          layoutcreator(y,sharedPreference);
                      }
                  });
                  RelativeLayout.LayoutParams np =
                          new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
                  np.addRule(RelativeLayout.BELOW,nextbt.getId());
                  np.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);                          
                  layout.addView(prevbt,np);
              }
  
              RelativeLayout.LayoutParams p = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
              p.addRule(RelativeLayout.BELOW,tv1.getId());
              p.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
              layout.addView(createRadioButton(i,sharedPreferences),p);
              setContentView(layout);
          }
          catch (JSONException e) {
              e.printStackTrace();
          }
  
      }
  
      private RadioGroup createRadioButton(int a, SharedPreferences sharedPreferences) {
  
          RadioGroup rg = new RadioGroup(this); // create the RadioGroup
          rg.setOrientation(LinearLayout.VERTICAL);
  
          final SharedPreferences sharedPreference = sharedPreferences;
          final RadioButton rb  = new RadioButton(this);
          final RadioButton rb1  = new RadioButton(this);
          final RadioButton rb2  = new RadioButton(this);
          try {
  
              rb.setText(jArray.getJSONObject(a).getString("o1"));
  
              rb.setOnClickListener(new OnClickListener() {
  
                  @Override
                  public void onClick(View v) {
                      if(sharedPreference.getBoolean("colorcheck", true)){
                          rb1.setTextColor(Color.WHITE);
                          rb2.setTextColor(Color.WHITE);
                          rb.setTextColor(Color.RED);
                      }
                      rb1.setChecked(false);
                      rb2.setChecked(false);
  
                  }               
              });
  
          } catch (JSONException e) {
              e.printStackTrace();
          }
          try {
              rb1.setText(jArray.getJSONObject(a).getString("o2"));
  
              rb1.setOnClickListener(new OnClickListener() {
  
                  @Override
                  public void onClick(View v) {
                      if(sharedPreference.getBoolean("colorcheck", true)){
                          rb1.setTextColor(Color.RED);
                          rb2.setTextColor(Color.WHITE);
                          rb.setTextColor(Color.WHITE);
                      }
  
                      rb.setChecked(false);
                      rb2.setChecked(false);
                  }
  
              });
  
          }
          catch (JSONException e) {
              e.printStackTrace();
          }
  
          try {
              rb2.setText(jArray.getJSONObject(a).getString("a"));
              rb2.setOnClickListener(new OnClickListener() {
  
                  @Override
                  public void onClick(View v) {
                      if(sharedPreference.getBoolean("colorcheck", true)){
                          rb1.setTextColor(Color.WHITE);
                          rb2.setTextColor(Color.GREEN);
                          rb.setTextColor(Color.WHITE);
                      }
  
                      rb1.setChecked(false);
                      rb.setChecked(false);
  
                  }               
              });
  
          }
          catch (JSONException e) {
              e.printStackTrace();
          }
  
          Random rand = new Random(); 
          int pickedNumber = rand.nextInt(3); 
  
          if(pickedNumber == 0){
              rg.addView(rb2);
              rg.addView(rb1);
              rg.addView(rb);         
          }   
  
          if(pickedNumber == 1){
              rg.addView(rb1);
              rg.addView(rb2);
              rg.addView(rb);         
          }
  
          if(pickedNumber ==2){
              rg.addView(rb1);                    
              rg.addView(rb);
              rg.addView(rb2);
          }
  
          return rg; // return RadioGroup
  
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.options_menu, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
          case R.id.list:
              startActivity(new Intent(getApplicationContext(), List.class));
              break;
          case R.id.settings:
              startActivity(new Intent(getApplicationContext(), ColorCheck.class));
              break;
          case R.id.scores:
              startActivity(new Intent(getApplicationContext(), Scores.class));
              break;
          }
          return true;
      }   
  }
  </code></pre>