I am trying to Create a Array Adapter to set content from an Array of text to the adapter but i am not able to set the adapter from the Activity. Am not sure what i should pass for the resource as Int

**PlacesListAdapter.java**

```
public class PlacesListAdapter extends ArrayAdapter<Place> {
    public Context context;
    private List<Place> places;

    public PlacesListAdapter(Context context, int textViewResourceId) {
        super(context, textViewResourceId);
    }

    public PlacesListAdapter(Context context, int resource, List<Place> places) {
        super(context, resource, places);
        this.context = context;
        this.places = places;
        // imageLoader = new ImageLoader(context.getApplicationContext());

    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        ViewHolder holder;
        View view = convertView;
        Place p = places.get(position);

        if (convertView == null) {
            LayoutInflater viewInflater;
            viewInflater = LayoutInflater.from(getContext());
            view = viewInflater.inflate(R.layout.item_place, null);

            holder = new ViewHolder();
            holder.placeTitle = (TextView) view.findViewById(R.id.place_title);
            holder.placeDistance = (TextView) view
                    .findViewById(R.id.place_distance);

            view.setTag(holder);

        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.placeTitle.setText(p.getPlaceTitle());
        holder.placeDistance.setText("200");
        holder.placeCategoryIcon.setImageResource(R.drawable.marker);

        return view;
    }

    static class ViewHolder {
        TextView placeId;
        TextView placeTitle;
        TextView placeDistance;
        ImageView placeCategoryIcon;
    }

}

```

**Place.java**

```
public class Place {

    String placeId = "", placeTitle = "", placeDistance = "",
            placeCategoryIcon = "";

    public Place(String placeId, String placeTitle, String placeDistance,
            String placeCategoryIcon) {
        this.placeId = placeId;
        this.placeTitle = placeTitle;
        this.placeDistance = placeDistance;
        this.placeCategoryIcon = placeCategoryIcon;
    }

    public String getPlaceId() {
        return placeId;
    }

    public void setPlaceId(String placeId) {
        this.placeId = placeId;
    }

    public String getPlaceTitle() {
        return placeTitle;
    }

    public void setPlaceTitle(String placeTitle) {
        this.placeTitle = placeTitle;
    }

    public String getPlaceDistance() {
        return placeDistance;
    }

    public void setPlaceDistance(String placeDistance) {
        this.placeDistance = placeDistance;
    }

    public String getPlaceCategoryIcon() {
        return placeCategoryIcon;
    }

    public void setPlaceCategoryIcon(String placeCategoryIcon) {
        this.placeCategoryIcon = placeCategoryIcon;
    }

}

```

**Now in MainActiivty i am trying to set the adapter so that it populates the list from the Array**

```
public class MainActivity extends SherlockFragmentActivity implements
        SearchView.OnQueryTextListener {

    private final String[] places = new String[] { "Mysore", "Bangalore", "Mangalore",
            "Wayanad", "Bandipur National Park", "Chickmaglur",
            "Bandipura", "Coorg", "Kodaikanal", "Hampi",
            "Ghati Subramanya", "Mekedatu", "Muththathhi", "Shivasamudram",
            "Talakadu", "Savana Durga" };

    public SearchView mSearchView;
    private TextView mStatusView;

    private Menu mainMenu = null;

    PlacesListAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Log.i("Nomad", "onCreate");

        ListView listView = (ListView) findViewById(R.id.place_list);

        adapter = new PlacesListAdapter(this, resource, places);

    }
}

```

I am not sure what to set for `resources` in `adapter = new PlacesListAdapter(this, resource, places);`