title: Unable to get a YouTube video to play with Android Studio
body: <p>I know that if you want to play a YouTube video, your activity has to extend <code>YouTubeBaseActivity</code> and implement <code>YouTubePlayer.OnInitialzedListener</code>, but what if those aren't being recognized in <strong>Android Studio</strong>?</p>
  
  <p>I've gotten it to work with <em>Eclipse</em> multiple times, but this is my first app in Android Studio and I'm not finding a lot of resources to help me know what to do differently.</p>
  
  <pre><code>public class VideoPlayerActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener{
  </code></pre>
  
  <p>This is the code in <code>onCreate</code> I used in Eclipse:</p>
  
  <pre><code>ytpv = (YouTubePlayerView) findViewById(R.id.youtubeplayer);
  ytpv.initialize(DEVELOPER_KEY, this);
  </code></pre>
  
  <p>Also this:</p>
  
  <pre><code>@Override
      public void onInitializationFailure(Provider arg0, YouTubeInitializationResult arg1) {
      Toast.makeText(this, "Initialization Fail", Toast.LENGTH_LONG).show();
  }
  </code></pre>
  
  <p>And the clincher where <code>filename</code> was just the youtube id:</p>
  
  <pre><code>@Override
  public void onInitializationSuccess(Provider provider, YouTubePlayer player, boolean wasrestored) {
      yt_player = player;
  
      Bundle info = getIntent().getExtras();
      if(info == null){
          Log.d(TAG, "No extras!");
          return;
      }
  
      fileName = info.getString("filename");
  
      if(fileName.equalsIgnoreCase("null")){
          availability.setVisibility(View.VISIBLE);
          ytpv.setVisibility(View.GONE);
      }else{
          Log.d(TAG, "Play video!");
          yt_player.loadVideo(fileName);
      }
  }
  </code></pre>
  
  <p>Layout file looks like this:</p>
  
  <pre><code>&lt;com.google.android.youtube.player.YouTubePlayerView
      android:id="@+id/youtubeplayer"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_below="@+id/eturl"
      &gt;
  &lt;/com.google.android.youtube.player.YouTubePlayerView&gt;
  </code></pre>
  
  <p>Any tips/advice/critique will be warmly welcomed.</p>