Android Load image on ImageView using arraylist
<p>This might be a problem that I might overlooked again but if you could help me solve it, I will be very thankful.
Using this code to get images from drawable and sending it to Imageview.setImageResource (in which my Imageview is inside a gridview);everything works well</p>

<pre><code>private   Integer[] imageIDs = {
            //R.drawable.image1,
            R.drawable.image2,
            R.drawable.image3,
            R.drawable.image4,
            R.drawable.image5,
            R.drawable.image6,
            R.drawable.Image7,
};

//Here is my another code to call imageIDs as ImageResource
ImageView iv = (ImageView)v.findViewById(R.id.grid_item_picture);
iv.setImageResource(imageIDs[position]);
//position is a default value of gridview starting from 0 
</code></pre>

<p>Now what I trying to accomplish is to delete that array and convert it to arraylist simply because need these inside data to be dynamic. And so ive created these new code</p>

<pre><code>ArrayList&lt;String&gt; array_image = new ArrayList&lt;String&gt;();
        array_image.add("R.drawable.image6");
        array_image.add("R.drawable.image1");
</code></pre>

<p>and set the ImageView ImageResource to this code</p>

<pre><code>iv.setImageResource(array_image .get(position));
</code></pre>

<p>I am getting an error saying: </p>

<blockquote>
  <p>The method setImageResource(int) in the type ImageView is not applicable for the arguments (Object)
  Can you help me fix/figure it out?</p>
</blockquote>
