title: Android adapter best practice when using attributes from activity
body: <p>My Adapter requires a context in order to apply resources to views, therefore when instantiating it, I might do the following within my Activity:</p>
  
  <pre><code>myAdapter = new MyAdapter(this);
  </code></pre>
  
  <p>As my adapter also needs data from an activity, I might do this:</p>
  
  <pre><code>myAdapter = new MyAdapter(myItemsArrayList,this);
  </code></pre>
  
  <p>As my adapter might also need to know which items in the ArrayList are selected, I might pass it that list too:</p>
  
  <pre><code>myAdapter = new MyAdapter(myArrayItemsList,mySelectedItemsArrayList,this);
  </code></pre>
  
  <p>And as there may be other states (e.g. whether to display photos in a list of people, the constructor call is starting to get quite lengthy:</p>
  
  <pre><code>myAdapter = new MyAdapter(myArrayItemsList,mySelectedItemsArrayList,myPreference1,myPreference2,this);
  </code></pre>
  
  <p>Given that the only place this adapter will be used is from a particular activity, how bad would it be to just make those attributes in the activity public, so that I can access them via the activity that has been passed (e.g <code>myActivity.myArrayItemsList</code>)?</p>
  
  <p>Many thanks in advance for any advice!</p>