title: Button Click Causes App To Crash
body: <p>I have just set an onClick method which is written in the activity class to be called whenever the button is clicked. Even before it enters the method, the app crashes.</p>
  
  <p>Error message that I am getting when the floating action button is clicked; </p>
  
  <pre><code>java.lang.IllegalArgumentException: Expected receiver of type com.example.bob.vexteamqueuing.AdminControl,
  but got android.support.v7.view.ContextThemeWrapper java.lang.IllegalArgumentException:
  Expected receiver of type com.example.bob.vexteamqueuing.AdminControl, but got android.support.v7.view.ContextThemeWrapper
  
  at java.lang.reflect.Method.invoke(Native Method)
  at android.view.View$DeclaredOnClickListener.onClick(View.java:4447)
  at android.view.View.performClick(View.java:5198)
  at android.view.View$PerformClick.run(View.java:21147)
  at android.os.Handler.handleCallback(Handler.java:739)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:148)   
  at android.app.ActivityThread.main(ActivityThread.java:5417)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  </code></pre>
  
  <p>XML Code for the activity:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;android.support.design.widget.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:theme="@style/NoActionBar"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          android:background="?attr/colorPrimary"
          app:popupTheme="@style/AppTheme.PopupOverlay"
          /&gt;
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;include layout="@layout/content_admin_control" /&gt;
  
  &lt;android.support.design.widget.FloatingActionButton
      android:id="@+id/fab"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="bottom|end"
      android:layout_margin="@dimen/fab_margin"
      android:src="@android:drawable/ic_input_add"
      android:onClick="createNewTournament"
      android:clickable="true" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>AdminControl activity Java code:</p>
  
  <pre><code>  public class AdminControl extends AppCompatActivity {
  
          Firebase ref;
          public static List &lt;Tournament&gt; tournaments;
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_admin_control);
              Toolbar b = (Toolbar) findViewById(R.id.toolbar);
              b.setTitle("Tournaments");
              setSupportActionBar(b);
              ref = AdminLogin.firebase.child("users").child(AdminLogin.firebase.getAuth().getUid());
              if (tournaments == null){
                  tournaments = new ArrayList&lt;&gt;();
              }        
          }
  
          public void createNewTournament(View v) {
              Intent newIntent = new Intent(this, TournamentCreator.class);
              startActivity(newIntent);
          }  
    }
  </code></pre>
  
  <p>On Create - Tournament Creator</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_tournament_creator);
      /*b = (FloatingActionButton) findViewById(R.id.fab);
      b.setOnClickListener(new View.OnClickListener(){
          @Override
          public void onClick(View v) {
              beginTournament(v);
          }
      });*/
  }
  </code></pre>
  
  <p>Manifest file - may not be necessary but just provided</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
  &lt;!-- To auto-complete the email text field in the login form with the user's emails --&gt;
  &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PROFILE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt;
  
  &lt;application
      android:name=".VEXQueuing"
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
      &lt;activity android:name=".Initial"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".AdminLogin"
          android:label="@string/title_activity_admin_login"
          android:parentActivityName=".Initial"&gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.example.bob.vexteamqueuing.Initial" /&gt;
      &lt;/activity&gt;
      &lt;activity android:name=".TournamentCreator" /&gt;
      &lt;activity
          android:name=".AdminControl"
          android:label="@string/title_activity_admin_control"
          android:parentActivityName=".Initial"
          android:theme="@style/NoActionBar"&gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.example.bob.vexteamqueuing.Initial" /&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>