title: Android admob fatal exception
body: <p>I am trying to ad admob ads to my app but I am getting this error in the logcat when it launches. The app ran fine before I added the admob so I think it's something to do with that.</p>
  
  <pre><code>03-16 19:08:00.683: E/AndroidRuntime(529): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.musicbynumbers.scalesads/com.musicbynumbers.scalesads.MainMenu}: java.lang.NullPointerException
  03-16 19:08:00.683: E/AndroidRuntime(529):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at android.os.Handler.dispatchMessage(Handler.java:99)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at android.os.Looper.loop(Looper.java:123)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at android.app.ActivityThread.main(ActivityThread.java:4627)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at java.lang.reflect.Method.invokeNative(Native Method)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at java.lang.reflect.Method.invoke(Method.java:521)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at dalvik.system.NativeStart.main(Native Method)
  03-16 19:08:00.683: E/AndroidRuntime(529): Caused by: java.lang.NullPointerException
  03-16 19:08:00.683: E/AndroidRuntime(529):  at com.musicbynumbers.scalesads.MainMenu.onCreate(MainMenu.java:69)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  03-16 19:08:00.683: E/AndroidRuntime(529):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  03-16 19:08:00.683: E/AndroidRuntime(529):  ... 11 more
  </code></pre>
  
  <p>Java of MainMenu:</p>
  
  <pre><code>   package com.musicbynumbers.scales;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.content.Intent;
  import android.graphics.PixelFormat;
  import android.view.View;
  import android.view.Window;
  import android.view.WindowManager;
  import android.widget.Button;
  import android.widget.ImageButton;
  import android.widget.Toast;
  
  import com.musicbynumbers.pianoscalesadscopy.R;
  
  
  
  
  
  
  public class MainMenu extends  LicenseCheckActivity implements View.OnClickListener   {
  
      Button majScales, minHarm, minMel, majArp, minArp, chrome, cont, pent,how;
      ImageButton mainMenu;
      Intent j;
      Intent k;
      Intent l;
      Intent m;
      Intent n;
      Intent o;
      Intent p;
      Intent q;
      Intent r;
  
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
           requestWindowFeature(Window.FEATURE_NO_TITLE);
          getWindow().setFormat(PixelFormat.RGBA_8888);
          getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
          setContentView(R.layout.activity_main_menu);
            Toast.makeText(this, "Checking Application License", Toast.LENGTH_SHORT).show();
            // Check the license
            //checkLicense();
           j = new Intent(MainMenu.this, majorScales.class);
           k = new Intent(MainMenu.this, minorHarmonic.class);
           l = new Intent(MainMenu.this, MajorArpeggios.class);
           m = new Intent(MainMenu.this, MinorArpeggios.class);
           n = new Intent(MainMenu.this, ChromaticScales.class);
           o = new Intent(MainMenu.this, ContraryMotion.class);
           p = new Intent(MainMenu.this, PentatonicScales.class);
           q = new Intent(MainMenu.this, minorMelodic.class);
           r = new Intent(MainMenu.this, HowItWorks.class);
  
          mainMenu = (ImageButton) findViewById(R.id.imagelogo);
          majScales = (Button) findViewById(R.id.majorscalesb);
          minHarm = (Button) findViewById(R.id.minorharmonicb);
          minMel = (Button) findViewById(R.id.minormelodicb);
          majArp = (Button) findViewById(R.id.majorarpeggiosb);
          minArp = (Button) findViewById(R.id.minorarpeggiosb);
          chrome = (Button) findViewById(R.id.chromaticscalesb);
          cont = (Button) findViewById(R.id.contraryb);
          pent = (Button) findViewById(R.id.pentatonicscaleb);
          how = (Button) findViewById(R.id.howitworksb);
          majScales.setOnClickListener(this);
          mainMenu.setOnClickListener(this);
          minHarm.setOnClickListener(this);
          minMel.setOnClickListener(this);
          majArp.setOnClickListener(this);
          minArp.setOnClickListener(this);
          chrome.setOnClickListener(this);
          cont.setOnClickListener(this);
          pent.setOnClickListener(this);
          how.setOnClickListener(this);
  
  
  
      }
  
  
  
  
  
  
  
  
  
          @Override
              public void onClick(View arg0) {
                  // TODO Auto-generated method stub
                  switch(arg0.getId()){
                  case R.id.imagelogo:
                      Intent i =  new Intent(MainMenu.this, MainMenu.class);
                      startActivity(i);
                      break;
                  case R.id.majorscalesb:
  
                      startActivity(j);
                      break;
                  case R.id.minorharmonicb:
  
                      startActivity(k);
                      break;
                  case R.id.majorarpeggiosb:
  
                      startActivity(l);
                      break;
                  case R.id.minorarpeggiosb:
  
                      startActivity(m);
                      break;
                  case R.id.chromaticscalesb:
  
                      startActivity(n);
                      break;
                  case R.id.contraryb:
  
                      startActivity(o);
                      break;
                  case R.id.pentatonicscaleb:
  
                      startActivity(p);
                      break;
                  case R.id.minormelodicb:
  
                      startActivity(q);
                      break;
  
                  case R.id.howitworksb:
  
                      startActivity(r);
                      break;
  
  
      }
  
  }
  }
  </code></pre>
  
  <p>activity_main_menu xml: </p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/musicbynumbersbg"
      android:orientation="vertical"
      android:weightSum="100"
      tools:context=".MainMenu" &gt;
  
      &lt;ImageButton
          android:id="@+id/imagelogo"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_weight="90"
          android:background="@drawable/topbanner"
          android:gravity="center" /&gt;
  
      &lt;ScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_weight="10" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical"
              android:weightSum="100" &gt;
  
              &lt;Button
                  android:id="@+id/howitworksb"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="How to Use the App" /&gt;
  
              &lt;Button
                  android:id="@+id/majorscalesb"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="Major Scales" /&gt;
  
              &lt;Button
                  android:id="@+id/minormelodicb"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="Minor Melodic Scales" /&gt;
  
              &lt;Button
                  android:id="@+id/minorharmonicb"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="Minor Harmonic Scales" /&gt;
  
              &lt;Button
                  android:id="@+id/majorarpeggiosb"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="Major Arpeggios" /&gt;
  
              &lt;Button
                  android:id="@+id/minorarpeggiosb"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="Minor Arpeggios" /&gt;
  
              &lt;Button
                  android:id="@+id/chromaticscalesb"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="Chromatic Scales" /&gt;
  
              &lt;Button
                  android:id="@+id/contraryb"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="Contrary Motion" /&gt;
  
              &lt;Button
                  android:id="@+id/pentatonicscaleb"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="Pentatonic Scale" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  &lt;com.google.ads.AdView android:id="@+id/ad"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      ads:adUnitId=" a15144ab55b99a9"
      ads:loadAdOnCreate="true"
      ads:adSize="BANNER"
      /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Thanks in advance for trying to help.</p>