title: How to pass the youtube video URL to a new activity in android Studios?
body: <p>I have 2 activities one shows the list of videos and the other activity displays the videos using YoutubePlayerView.I use an on click button when pressed open a new activity with the youtubeplayerview.Now what i wanted is not open a new activity always for a new video insted i want to pass the youtube video as an argument so that it dosn't require many activities,just uses a single activity to display all the videos.My code is as shown below. </p>
  
  <ol>
  <li><p>ONclick new activity using an intent.</p>
  
  <pre><code> public void videoTitaniumOnClick(View view){
          Intent i=new Intent(this,videoGenerator.class);
          startActivity(i);
  
      }
  </code></pre></li>
  <li><p>Youtube video class Code.</p>
  
  <pre><code>public class videoGenerator extends YouTubeBaseActivity implements OnInitializedListener {
     public static final String API_KEY = "XXXXXXXXXXXX";
     public static final String VideoTitanium = "ySQoAiWPXHE";
     @Override
      public boolean onCreateOptionsMenu(Menu menu)
      {
          getMenuInflater().inflate(R.menu.menu, menu);
          return true;
      }
  
  
     @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_video_generator);
  
          /** Initializing YouTube player view **/
          YouTubePlayerView youTubePlayerView = (YouTubePlayerView)         findViewById(R.id.Youtube);
          youTubePlayerView.initialize(API_KEY, this);
      }
  
     @Override
      public void onInitializationSuccess(Provider provider, YouTubePlayer player, boolean wasRestored) {
  
          /** add listeners to YouTubePlayer instance **/
          /** Start buffering **/
          if (!wasRestored) {
              player.cueVideo(VideoTitanium);
          }
  
      }
  
      @Override
      public void onInitializationFailure(Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
  
          Toast.makeText(this, "Failured to Initialize Your Video.Check if you have a proper internet!", Toast.LENGTH_LONG).show();
  
       }
  }
  </code></pre>
  
  <p>Sorry if anything was wrong in the indentation.Expect the answer to be a bit clear as i am new to java and android,
  Thankyou.</p></li>
  </ol>