title: Getting the android context in an adapter
body: <p>In many of the code samples that I find on the internet the <code>context</code> is obtained in the constructor of an adapter.</p>
  
  <p>This context is used to get an <code>inflater</code> to inflate the views in <code>getView</code> method.</p>
  
  <p>My Question is why bother getting the context in the constructor when it can easily be obtained like so</p>
  
  <pre><code>        LayoutInflater inflater;
          @Override
          public View getView(int position, View convertView, ViewGroup parent) {
              if(inflater == null){
              Context context = parent.getContext();
              inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              }
              ...
              ...
  
              return convertView;
          }
  </code></pre>
  
  <p>Also is there any reason not to use the above method because it till now I have not faced any problem in using it .</p>