title: Getting error while trying to make list of youtube video
body: <p>I want to show list of youtube videos</p>
  
  <p><strong>Item XML</strong></p>
  
  
  
  <p></p>
  
  <pre><code>&lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;TextView
          android:id="@+id/video_title"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@color/model_black"
          android:ellipsize="end"
          android:padding="@dimen/medium_margin"
          android:singleLine="false"
          android:text="Title"
          android:textColor="@color/white"
          android:textSize="@dimen/large_text"
          android:textStyle="bold" /&gt;
  
      &lt;fragment
          android:id="@+id/youtube_thumbnail"
          android:name="com.google.android.youtube.player.YouTubeThumbnailView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/video_title"
          android:layout_marginLeft="@dimen/small_margin"
          android:layout_marginRight="@dimen/small_margin" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>Adapter code</strong> </p>
  
  <pre><code>public class VideoListAdapter extends BaseAdapter implements
      YouTubeThumbnailView.OnInitializedListener {
  
  private Context context;
  private ArrayList&lt;Video&gt; data = new ArrayList&lt;Video&gt;();
  private Map&lt;View, YouTubeThumbnailLoader&gt; mLoaders = new HashMap&lt;View, YouTubeThumbnailLoader&gt;();
  
  public class ViewHolder {
  
      TextView diyTitle;
      YouTubeThumbnailView  youTubeThumbnailView ;
  }
  
  public VideoListAdapter(Context context, ArrayList&lt;Video&gt; data) {
  
      this.context = context;
      this.data = data;
  }
  
  @Override
  public View getView(final int position, View convertView, ViewGroup parent) {
  
      ViewHolder holder = null;
      LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
  
      if (convertView == null) {
  
          holder = new ViewHolder();
          convertView = mInflater.inflate(R.layout.item_video, null);
          convertView.setTag(holder);
  
      } else {
          holder = (ViewHolder) convertView.getTag();
      }
  
      holder.diyTitle                 = (TextView) convertView.findViewById(R.id.video_title);
      holder.youTubeThumbnailView     = (YouTubeThumbnailView) convertView.findViewById(R.id.youtube_thumbnail);
  
      final Video current = data.get(position);
  
      holder.diyTitle.setText(current.getEnglishTitle());
  
      holder.youTubeThumbnailView.setTag(current.getValue());
      holder.youTubeThumbnailView .initialize(AppConstants.YOUTUBE_KEY, this);
  
      return convertView;
  }
  
  @Override
  public int getCount() {
      return data.size();
  }
  
  @Override
  public Object getItem(int position) {
      return data.get(position);
  }
  
  @Override
  public long getItemId(int position) {
      return data.indexOf(getItem(position));
  }
  
  @Override
  public void onInitializationFailure(YouTubeThumbnailView view, YouTubeInitializationResult errorReason) {
  
      // TODO
  }
  
  @Override
  public void onInitializationSuccess(YouTubeThumbnailView view, YouTubeThumbnailLoader loader) {
  
      String videoId = (String) view.getTag();
      mLoaders.put(view, loader);
      view.setImageResource(R.drawable.app_icon);
      loader.setVideo(videoId);
  }
  }
  </code></pre>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>android.view.InflateException: Binary XML file line #29: Error inflating class fragment
      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
      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 com.assiakitchen.view.adapter.VideoListAdapter.getView(VideoListAdapter.java:50)
      at android.widget.AbsListView.obtainView(AbsListView.java:2306)
      at android.widget.ListView.measureHeightOfChildren(ListView.java:1263)
      at android.widget.ListView.onMeasure(ListView.java:1175)
      at android.view.View.measure(View.java:16574)
      at android.widget.RelativeLayout.measureChild(RelativeLayout.java:689)
      at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:473)
      at android.view.View.measure(View.java:16574)
      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5140)
      at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
      at android.view.View.measure(View.java:16574)
      at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719)
      at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455)
      at android.view.View.measure(View.java:16574)
      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5140)
      at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
      at android.view.View.measure(View.java:16574)
      at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719)
      at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455)
      at android.view.View.measure(View.java:16574)
      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5140)
      at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
      at android.view.View.measure(View.java:16574)
      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5140)
      at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1406)
      at android.widget.LinearLayout.measureVertical(LinearLayout.java:697)
      at android.widget.LinearLayout.onMeasure(LinearLayout.java:590)
      at android.view.View.measure(View.java:16574)
      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5140)
      at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
      at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2421)
      at android.view.View.measure(View.java:16574)
      at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1959)
      at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1155)
      at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1337)
      at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1042)
      at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5960)
      at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
      at android.view.Choreographer.doCallbacks(Choreographer.java:574)
      at android.view.Choreographer.doFrame(Choreographer.java:544)
      at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
      at android.os.Handler.handleCallback(Handler.java:733)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:136)
      at android.app.ActivityThread.main(ActivityThread.java:5118)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
      at dalvik.system.NativeStart.main(Native Method)
   Caused by: android.app.Fragment$InstantiationException: Trying to instantiate a class com.google.android.youtube.player.YouTubeThumbnailView that is not a Fragment
      at android.app.Fragment.instantiate(Fragment.java:585)
      at android.app.Fragment.instantiate(Fragment.java:561)
      at android.app.Activity.onCreateView(Activity.java:4822)
      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
      ... 55 more
   Caused by: java.lang.ClassCastException
  </code></pre>
  
  <p>Can any one help please?</p>