title: Fragment cannot be converted to Context
body: <p>This is my first time using fragments (new to android dev) and I'm trying to set up a spinner.  At the moment I am quite confused about context and can't seem to solve this error:</p>
  
  <pre><code>Error:(52, 78) error: incompatible types: HotkeysFragment cannot be converted to Context
  </code></pre>
  
  <p>Here is the code its referring to:</p>
  
  <p>HotkeysFragment.java</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      if (getArguments() != null) {
          mParam1 = getArguments().getString(ARG_PARAM1);
          mParam2 = getArguments().getString(ARG_PARAM2);
      }
  
      Spinner hotkey_selector_spinner = (Spinner) rootView.findViewById(R.id.hotkey_selector_spinner);
  
      ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this,
              R.array.hotkey_options, android.R.layout.simple_spinner_item);
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      hotkey_selector_spinner.setAdapter(adapter);
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      final View rootViewB = inflater.inflate(R.layout.fragment_hotkeys, container, false);
      rootView = rootViewB;
      return rootViewB;
  }
  </code></pre>
  
  <p>The specific line is:</p>
  
  <pre><code>ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this,
              R.array.hotkey_options, android.R.layout.simple_spinner_item);
  </code></pre>
  
  <p>Imports:</p>
  
  <pre><code>import android.app.Activity; 
  import android.net.Uri;
  import android.os.Bundle;
  import android.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.Spinner;
  import java.util.zip.Inflater;
  </code></pre>
  
  <p>How can I fix this?</p>