title: could not be instantiated com.google.android.youtube.player.YouTubePlayerView
body: <p>Am new in android development.Am trying to implement youtube Api. But in my XML file it show error "could not be instantiated:
  - com.google.android.youtube.player.YouTubePlayerView"</p>
  
  <p>Here is My MAinActivity Code:-</p>
  
  <pre><code>public class MainActivity extends YouTubeBaseActivity {
  Button b;
  private YouTubePlayerView youtubeplayerview;
  private YouTubePlayer.OnInitializedListener onInitializedListener;
  
  
  @Override
  public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
      super.onCreate(savedInstanceState, persistentState);
      setContentView(R.layout.activity_main);
  
      youtubeplayerview=(YouTubePlayerView)findViewById(R.id.Youtube_view);
      onInitializedListener=new YouTubePlayer.OnInitializedListener(){
          @Override
          public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
              youTubePlayer.loadVideo("wvjqFy33HVA");
          }
  
          @Override
          public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
  
          }
      };
      b=(Button)findViewById(R.id.button);
      b.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              youtubeplayerview.initialize("API KEY",onInitializedListener);
          }
      });
  }
  }
  </code></pre>
  
  <p>Here is my XML file Code:-</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  &gt;
  
  &lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="PLAY VEDIO"
      android:id="@+id/button"
      android:layout_centerVertical="true"
      android:layout_centerHorizontal="true" /&gt;
  
  &lt;com.google.android.youtube.player.YouTubePlayerView
      android:layout_width="500dp"
      android:layout_height="500dp"
      android:id="@+id/Youtube_view"
      android:layout_alignParentTop="true"
      android:layout_above="@+id/button"
      android:layout_alignParentRight="true"
      android:layout_alignParentEnd="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true" /&gt;
  </code></pre>
  
  <p></p>
  
  <p><a href="http://i.stack.imgur.com/9imsH.png" rel="nofollow">Here is Error Screenshot</a></p>