Integrating youtube to fragment
First extend your Activity as normal class YourActivity extends Activity… in Layout file put the below lines <fragment android:name=”com.google.android.youtube.player.YouTubePlayerSupportFragment” android:id=”@+id/youtube_fragment” android:layout_width=”match_parent” android:layout_height=”wrap_content”/> Then in your Activity you can create its instance using below line in your onCreareView method of your Fragment. YouTubePlayerSupportFragment youTubePlayerFragment = (YouTubePlayerSupportFragment) getActivity().getSupportFragmentManager() .findFragmentById(R.id.youtube_fragment); or you can declare a FrameLayout in your … Read more