title: Android getSystemService inside custom ArrayAdapter
body: <p>I was trying to write a custom ArrayAdapter referencing <a href="http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/" rel="noreferrer">here</a>
  My code is </p>
  
  <pre><code>package com.example.AndTest;
  
  import java.util.ArrayList;
  
  import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.TextView;
  
  public class CategoryAdapter extends ArrayAdapter&lt;Category&gt; {
      private ArrayList&lt;Category&gt; items;
  
      public CategoryAdapter(Context context, int textViewResourceId,
              ArrayList&lt;Category&gt; items) {
          super(context, textViewResourceId, items);
          this.items = items;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          View v = convertView;
          if (v == null) {
              LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              v = vi.inflate(R.layout.list, null);
          }
          Category c = items.get(position);
          if (c != null) {
              TextView itemId = (TextView) v.findViewById(R.id.itemid);
              TextView itemLabel = (TextView) v.findViewById(R.id.itemlabel);
              if (itemId != null) {
                  itemId.setText("Name: " + c.getId());
              }
              if (itemLabel != null) {
                  itemLabel.setText("Status: " + c.getTitle());
              }
          }
          return v;
      }
  }
  </code></pre>
  
  <p>But I'm getting error message on the line
  <code>LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);</code></p>
  
  <p><code>The method getSystemService(String) is undefined for the type CategoryAdapter</code></p>
  
  <p>Am i missing something..</p>
  
  <pre><code>public class Category implements Parcelable {
  ....
  }
  </code></pre>