title: Add a new image to a view
body: <p>I am trying to add the same image to a view. I have a timer that will go off every 20 minutes and I want to add an image to show that the user has completed one timer. </p>
  
  <p>After some <a href="http://stacktips.com/tutorials/android/android-gridview-example-building-image-gallery-in-android" rel="nofollow noreferrer">research</a> I have found that I need to use an ArrayAdapter. The problem is I don't understand what any of that code is doing. Can someone explain it to me? </p>
  
  <p>What I have found so far is:</p>
  
  <pre><code>protected void onCreate(){
  
  //I need to create a gridview (it could be any type of view)
  gridLayout = (GridView) findViewById(R.id.gridLayout);//created in Studio GUI
  
  //Create an image
  ImageView myImage = new ImageView(this);
  myImage.setImageResource(R.mipmap.ic_launcher);
  
  //Create an image list
  private List&lt;ImageView&gt; imgs = new ArrayList&lt;ImageView&gt;();
  
  //add images to list (this will need to be added to the timer later)
  for (i = 0; i &lt; numberOfTimersHit; i++){
      imgs.add(myImage);
      }
  
  //add the list to an ArrayAdapter
  //This is where I need help
  
  //add the ArrayAdapter to the grid
  gridLayout.setAdapter(imageViewArrayAdapter);
  </code></pre>
  
  <p>Any help would be appreciated. Feel free to correct anything I have missed.</p>