title: Why to use Inflater in listview
body: <ul>
  <li>I always had ambiguity on why we need to use inflater in android, Why are they used in ListView for custom layouts (like below)?</li>
  <li>What is an Inflater ? </li>
  <li>What is the advantage of using Inflater ?</li>
  </ul>
  
  <hr>
  
  <pre><code>public class MobileArrayAdapter extends ArrayAdapter&lt;String&gt; {
      private final Context context;
      private final String[] values;
  
  
  public MobileArrayAdapter(Context context, String[] values) {
      super(context, R.layout.list_mobile, values);
      this.context = context;
      this.values = values;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      LayoutInflater inflater = (LayoutInflater) context
          .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      View rowView = inflater.inflate(R.layout.list_mobile, parent, false);
      TextView textView = (TextView) rowView.findViewById(R.id.label);
      ImageView imageView = (ImageView) rowView.findViewById(R.id.logo);
      textView.setText(values[position]);
  </code></pre>
  
  <p><strong>Thanks,</strong></p>