title: getExtra() for Intent in Adapter Class
body: <p><strong>I am very beginner</strong></p>
  
  <p>I can't seem to be able to use getExtra() when I am creating the Intent myIntent instance outside a method, I was able to use it inside the method which I called callEditActivity()</p>
  
  <p>However, I am trying to pass the string values (of img0, img1...etc) to the String Array StringGalImages; I can't figure how; I have tried this.img inside CallEditActivity but the values weren't passed. </p>
  
  <p>I have also tried explicit urls as img0 ="www.something.com/image.jpg" inside CallEditActivity , and couldn't pass it to the array.</p>
  
  <p>It worked only when initializing the img0 outside the method but I can't do this the getExtra, I am obliged to use the getExtra only inside CallEditActivity.</p>
  
  <p>So how I can get the value gotten from getExtra to the String Array?</p>
  
  <pre><code>public class ImageAdapter1 extends PagerAdapter {
  
  Context context;
  
  private String img0;
  private String img1;
  private String img2;
  private String img3;
  private String img4;
  
  public void callEditActivity() {
      Intent myIntent = new Intent(context, BirdsGalleryActivity.class);
  
      img0 = myIntent.getExtras().getString("IMG0");
      img1 = myIntent.getExtras().getString("IMG1");
      img2 = myIntent.getExtras().getString("IMG2");
      img3 = myIntent.getExtras().getString("IMG3");
      img4 = myIntent.getExtras().getString("IMG4");
  
  }
  
  private String[] StringGalImages = new String[] {
  
     img0,img1,img2,img3,img4
  
  };
  </code></pre>