title: How to pass context to repository in MVP pattern
body: <p>I have been learning and integrating <code>MVP pattern</code>, and have few questions. </p>
  
  <p>What i have understand from this diagram, is that </p>
  
  <p>Activity will create instance of <code>Presenter</code>, and pass its reference and <code>model</code> object to the presenter</p>
  
  <pre><code>MainPresenter mainPresenter = new MainPresenter(this, new MainModel());
  </code></pre>
  
  <p>Next if presenter need to store or get any data from local preference or remotely, it will ask model.</p>
  
  <p>And then model will ask repository for storing and retrieving data. </p>
  
  <p><a href="https://i.stack.imgur.com/yDSba.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yDSba.png" alt="enter image description here"></a></p>
  
  <p>I followed few tutorials and this is how i implement the pattern. </p>
  
  <p><strong>Interface</strong></p>
  
  <pre><code>public interface MainActivityMVP {
  
      public interface Model{
  
      }
  
      public interface View{
          boolean isPnTokenRegistered();
      }
  
      public interface Presenter{
  
      }
  }
  </code></pre>
  
  <p><strong>Activity</strong></p>
  
  <pre><code>MainPresenter mainPresenter = new MainPresenter(this, new MainModel());
  mainPresenter.sendDataToServer();
  </code></pre>
  
  <p><strong>Presenter</strong></p>
  
  <pre><code>public void sendDataToServer() {
  
      //  Here i need to ask `model` to check 
          do network operation and save data in preference
  }
  </code></pre>
  
  <p>Now the issue is i need context to access <code>sharedPreference</code>,  but i have not passed <code>context</code> anywhere. I also don't want to use <code>static context</code>. I want to know the proper way of passing context to MVP pattern. </p>