XML : A YouTubePlayerView can only be created with an Activity which extends YouTubeBaseActivity as its context

I'm getting this error is my XML file but can't figure it out as my Activity already extends YouTubeBaseActivity. Can anybody help me?

  <com.google.android.youtube.player.YouTubePlayerView          android:id="@+id/youtube_view"          android:layout_width="match_parent"          android:layout_height="wrap_content"          android:layout_marginBottom="30dp" />  

Activity:

  public class UserHomepage extends YouTubeBaseActivity implements      YouTubePlayer.OnInitializedListener    

Stack Trace

  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.<init>(Unknown Source)  at com.google.android.youtube.player.YouTubePlayerView.<init>(Unknown Source)  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)  at java.lang.reflect.Constructor.newInstance(Constructor.java:422)    

No comments:

Post a Comment