title: Buttons clicks and HashMap Android Studio
body: <p>I'm trying to use the randomVideo variable in my method, but each time I click on ANY button, the variable RandomVideo gets a new String.</p>
  <p>But I want to keep the randomVideo as it is Unless the button youtube_random is clicked and not any button.</p>
  <p>Cause  each time I click english_button or spanish_button , it's changing the randomVideo variable to something else (I do not want that)
  And if I declare randomVideo variable inside the youtube_random button, I cannot use the variable with the other buttons.</p>
  <pre class="lang-java prettyprint-override"><code>public void onClick(View v) {
    String randomVideo = (String) videos.getVideos().keySet()
       .toArray()[new Random()
       .nextInt(videos.getVideos().keySet().toArray().length)];
    switch(v.getId()){
      
      case R.id.youtube_random:
            mYoutubePlayer.loadVideo(randomVideo);
      
         case R.id.english_button : 
                      if (videos.getVideos().get(randomVideo).equals(&quot;English&quot;))
      
                          btnEnglish.setBackgroundColor(Color.GREEN);
                      else{
                          btnEnglish.setBackgroundColor(Color.RED);
                      }
      
            case R.id.spanish_button:
                      if (videos.getVideos().get(randomVideo).equals(&quot;Spanish&quot;))
                          btnSpanish.setBackgroundColor(Color.GREEN);
                      else{
                          btnSpanish.setBackgroundColor(Color.RED);
                      }
      
      }
  
  </code></pre>