passing data from model to view via controller
<p>I'm trying to create an MVC pattern in my android whack-a-mole game. </p>

<p>I'm generating mole locations in the model via an inner class thread and want to eventually pass it to the view so that it would generate a sprite for it. </p>

<p>how do I create a way for my view to continuously receive the generated mole locations from my model?</p>

<p>I've edited my code below to capture the essentials behind them.</p>

<p><strong>MODEL :</strong> </p>

<pre><code>public class GameModel{
   public GameModel(){
      spawner = new MoleSpawner();
      spawner.start();
   }
.
.
.
   private class MoleSpawner extends Thread{
      private int location;
      public void run() {
          location = new Random().nextInt(20);
          try{
             sleep (1000);
          } catch (InterruptedException ex){
             ex.printStackTrace();
          }
      }
   }
}
</code></pre>

<p><strong>VIEW:</strong></p>

<pre><code>public GameView{
.
.
.
  public void createMoleSprite(int newlocation){
     //create sprites here
     //newlocation should come from the MODEL
     //this method must be triggered everytime the MODEL creates a new location
  }
}
</code></pre>
