Android how to add different images to each list item on spinner?
<p>Following is a place selector and i want to add different icons to this spinner list view. Its for the application that i'm trying to develop. This way i can use the same to other spinners as well</p>

<pre><code>public class Addplace extends Activity implements OnItemSelectedListener {

    public String items;
    EditText name;
    Button add;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.addpoint);

        // Spinner element
        Spinner spinner = (Spinner) findViewById(R.id.spinner);
        name = (EditText) findViewById(R.id.nameplace);
        add = (Button) findViewById(R.id.addplace);

        // Spinner click listener
        spinner.setOnItemSelectedListener(this);

        // Spinner Drop down elements
        List&lt;String&gt; categories = new ArrayList&lt;String&gt;();
        categories.add("Outdoor");
        categories.add("Shop");
        categories.add("Professional &amp; Other place");
        categories.add("College &amp; University");
        categories.add("Food");
        categories.add("Travel");
        categories.add("Residences");
        categories.add("Club");
        categories.add("Bar &amp; Pub");
        categories.add("Services");

        // Creating adapter for spinner
        ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;String&gt;(this,
                android.R.layout.simple_spinner_item, categories);

        // Drop down layout style - list view with radio button
        dataAdapter
                .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

        // attaching data adapter to spinner
        spinner.setAdapter(dataAdapter);

        add.setOnClickListener(new View.OnClickListener() {

            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                String nameplace = name.getText().toString();

                Toast.makeText(getApplicationContext(), nameplace + items,
                        Toast.LENGTH_SHORT).show();
            }
        });
    }

    public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position,
            long id) {
        // On selecting a spinner item
        items = parent.getItemAtPosition(position).toString();
    }

    public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
        // TODO Auto-generated method stub

    }

}
</code></pre>

<p>Please be kind enough to help. </p>

<p>thnx</p>
