title: Cannot declare ViewHolder as static inner class
body: <p>In my application, I am using a listview and have customized the associated array adapter by extending the standard the array adapter.However,inside the extended adapter, I am unable to declare the viewholder as a static inner class. Eclipse keeps giving the error that "static types can only be declared in static or top level types". Here is the code:</p>
  
  <pre><code>public class IconicAdapter extends ArrayAdapter&lt;String&gt;
  {
      public static class ViewHolder
      {
          public TextView text;
          public ImageView image;
      }
  
      public IconicAdapter() {
          super(MainActivity.this,R.layout.row,values);
          // TODO Auto-generated constructor stub
      }
  
      public View getView(int position,View convertView, ViewGroup parent)
      {
          View row = convertView;
          if(row == null)
          {
              LayoutInflater inflater = getLayoutInflater();
              row = inflater.inflate(R.layout.row, parent,false);
          }
          TextView label =(TextView)row.findViewById(R.id.label);
          label.setText(values[position]);
          ImageView icon = (ImageView)row.findViewById(R.id.icon);
          icon.setImageResource(R.drawable.ok);
  
          return (row);
      }
  }
  </code></pre>
  
  <p>Any suggestion?</p>