title: YouTubePlayer together with AppCompat v7 library
body: <p>I have developed an app that uses <code>YouTube android API</code> to play a certain video inside the app. At that time I have used as target API 19, and also target API 19. Now I want do change the design of the app switching to <code>Material Design</code> using target API 22 and also using <code>AppCompat-v7 :22+ library</code>. But the <code>YouTubeBaseActivity</code> cant be opened and the application crashes. Below I will post what I have done so far.</p>
  
  <p>EventDetail.java</p>
  
  <pre><code>public class EventDetail extends YouTubeBaseActivity implements
          YouTubePlayer.OnInitializedListener { .
  .
  .
  protected void onCreate(Bundle savedInstanceState) {
  
          // remove the shadow from action bar
          setTheme(R.style.Theme_TranslucentActionBar_ActionBar_NoOverlay);
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_event_detail);
  
          // enable back button
  
          getSupportActionBar().setHomeButtonEnabled(true);
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  
          // setting the action bar initially transparent
          mActionBarBackgroundDrawable = new ColorDrawable(
                  Color.parseColor("#ec5c59"));
          mActionBarBackgroundDrawable.setAlpha(0);
  
          getSupportActionBar().setBackgroundDrawable(mActionBarBackgroundDrawable);
  
          // binding the scrollview
  
  ...
  </code></pre>
  
  <p>Manifest File</p>
  
  <pre><code>&lt;activity
          android:name="com.dev.apk.evente.al.EventDetail"
          android:icon="@drawable/ikona_projekte"
          android:label="@string/title_activity_event_detail"
          android:screenOrientation="portrait"
          android:theme="@style/Theme.TranslucentActionBar.ActionBar.Overlay" /&gt;
  </code></pre>
  
  <p>Layut File:</p>
  
  <pre><code>&lt;RelativeLayout
      android:id="@+id/video_layout"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginBottom="20dp"
      android:paddingLeft="23dp"
      android:paddingRight="23dp"
      android:paddingBottom="15dp"
      android:background="@drawable/event_background_block" &gt;
  
      &lt;TextView
          android:id="@+id/video_label"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp"
          android:background="@color/white"
          android:gravity="left"
          android:paddingTop="10dp"
  
          android:paddingBottom="10dp"
          android:text="Video"
          android:textColor="@color/VeryDarkGray"
          android:textSize="22sp" &gt;
      &lt;/TextView&gt;
  
      &lt;com.google.android.youtube.player.YouTubePlayerView
          android:id="@+id/youtube_view"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/video_label"
          android:background="@color/white" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Theme.xml File</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
  
      &lt;style name="Theme.TranslucentActionBar" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
  
          &lt;item name="android:actionBarStyle"&gt;@style/Widget.ActionBar&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="Theme.TranslucentActionBar.ActionBar" /&gt;
  
      &lt;style name="Theme.TranslucentActionBar.ActionBar.Overlay"&gt;
          &lt;item name="android:actionBarStyle"&gt;@style/Widget.ActionBar.Transparent&lt;/item&gt;
          &lt;item name="android:windowActionBarOverlay"&gt;true&lt;/item&gt;
          &lt;item name="colorPrimary"&gt;@color/evente_date_color&lt;/item&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/evente_darken_color&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;!-- Theme without ActionBar shadow (inherits main theme) --&gt;
  
      &lt;style name="Theme.TranslucentActionBar.ActionBar.NoOverlay" parent="Theme.TranslucentActionBar.ActionBar.Overlay"&gt;
          &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt;
      &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>So at the beginning it doesn't open because the method <code>getActionBar()</code> return Null, then i changed it to <code>getSupportActionBar()</code>  but i doesn't recognized it. Then at the end I changed this line in the following:</p>
  
  <pre><code>public class EventDetail extends AppCompatActivity implements
          YouTubePlayer.OnInitializedListener {
  </code></pre>
  
  <p>and it gives me the following error:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myikub.al/com.dev.apk.evente.al.EventDetail}: android.view.InflateException: Binary XML file line #250: Error inflating class com.google.android.youtube.player.YouTubePlayerView
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2342)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
      at android.app.ActivityThread.access$600(ActivityThread.java:148)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:150)
      at android.app.ActivityThread.main(ActivityThread.java:5406)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:525)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      at dalvik.system.NativeStart.main(Native Method)
  Caused by: android.view.InflateException: Binary XML file line #250: Error inflating class com.google.android.youtube.player.YouTubePlayerView
      at android.view.LayoutInflater.createView(LayoutInflater.java:620)
      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
      at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249)
      at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
      at com.dev.apk.evente.al.EventDetail.onCreate(EventDetail.java:112)
      at android.app.Activity.performCreate(Activity.java:5303)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2296)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
      at android.app.ActivityThread.access$600(ActivityThread.java:148)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:150)
      at android.app.ActivityThread.main(ActivityThread.java:5406)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:525)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.reflect.InvocationTargetException
      at java.lang.reflect.Constructor.constructNative(Native Method)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
      at android.view.LayoutInflater.createView(LayoutInflater.java:594)
      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
      at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249)
      at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
      at com.dev.apk.evente.al.EventDetail.onCreate(EventDetail.java:112)
      at android.app.Activity.performCreate(Activity.java:5303)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2296)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
      at android.app.ActivityThread.access$600(ActivityThread.java:148)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:150)
      at android.app.ActivityThread.main(ActivityThread.java:5406)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:525)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.IllegalStateException: A YouTubePlayerView can only be created with an Activity  which extends YouTubeBaseActivity as its context.
      at com.google.android.youtube.player.YouTubePlayerView.&lt;init&gt;(Unknown Source)
      ....
  </code></pre>
  
  <p>I am using Android Studio. Any idea will be appreciated.</p>