title: how can i use local String value in another method
body: <p>i have passed data from recyclerview mainactivity to exoplayer activity through intent.now problem is i want use that value in another method. so how can i use that value in another method.</p>
  
  <p>exoplayer activity:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_exoplayer);
  
          thumb = findViewById(R.id.thumb);
          head = findViewById(R.id.head);
  
          String image = getIntent().getStringExtra("image");
          String title = getIntent().getStringExtra("title");
  
          //i want use this String value in different method
          String url = getIntent().getStringExtra("url");
  
          head.setText(title);
          Glide.with(this).asBitmap().load(image).into(thumb);
  
          initializeplayer();
      }
  
      //i want use that string value in this method.
      public void initializeplayer(){
  
          playerView = findViewById(R.id.exo);
          simpleExoPlayer = ExoPlayerFactory.newSimpleInstance(this);
          playerView.setPlayer(simpleExoPlayer);
  
          DataSource.Factory datasourcefactory = new DefaultDataSourceFactory(this,
                  Util.getUserAgent(this, "appname"));
  
          MediaSource mediaSource = new ExtractorMediaSource.Factory(datasourcefactory)
                  .createMediaSource(Uri.parse(url1));
          simpleExoPlayer.prepare(mediaSource);
          simpleExoPlayer.setPlayWhenReady(true);
      }
  </code></pre>