title: How to use YouTube Android Player API with AppCompatActivity
body: <p>To play a video in my app I decided to extend from YouTube Android Player API. But the problem is my menu is disappeared because I'm not extending from AppCompatActivity. The question is: how to use YouTube Android Player API and have the menu in the app?</p>
  
  <pre><code>public class TutorialsActivity extends YouTubeBaseActivity {
  
  private YouTubePlayerView youTubePlayerView;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.youtube);
  
      youTubePlayerView = (YouTubePlayerView) findViewById(R.id.video1);
      youTubePlayerView.initialize(API_KEY, new YouTubePlayer.OnInitializedListener() {
          @Override
          public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
              youTubePlayer.loadVideo("c9q88492aas");
              youTubePlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.MINIMAL);
          }
  
          @Override
          public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
  
          }
      });
  }
  </code></pre>
  
  <p>XML</p>
  
  <pre><code>    &lt;com.google.android.youtube.player.YouTubePlayerView
      android:id="@+id/video1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      /&gt;
  </code></pre>
  
  <p>When I extend from AppCompatActivity, it just gives me an error.</p>
  
  <p>Error Log:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hyber.app/com.hyber.app.TutorialsActivity}: android.view.InflateException: Binary XML file line #12: Binary XML file line #12: Error inflating class com.google.android.youtube.player.YouTubePlayerView
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xNKaJ.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/xNKaJ.jpg" alt="enter image description here"></a></p>