title: Can't save the images names from drawable in a String[]
body: <p>I have in my drawable folder my photos with names photo_1,photo_2 etc. I want to save only these images in my database. I have a table with fields (id, name). This function must return a string array with the images names (not all the images names of the drawable just that a called photo_1 etc).
  I get an error here "cur[r] = s;". Can't understand why...
  Can anyone help?</p>
  
  <pre><code>public static String[] getImagesNames()
  {
  int r=0;
  String s;
  String[] cur=null, nam=null;
  Field[] dr = R.drawable.class.getFields();
  for(Field f : dr)
  
  s = "R.drawable."+f.getName();
  cur[r] = s;
  r++;
  }
  for(int j=0;j&lt;=r;j++)
  {
  for(int k=0;k&lt;=r;k++)
  {
  if((cur[j]).equals("photo_"+k))
  {
  nam[j] = cur[j];
  }
  }
  }
  return nam;
  }
  </code></pre>