Image button like spinner
<p>I am looking to have a image button which acts like a spinner in XML. I have found some information on this but nothing like what am after. So when i click a image view a spinner will appear with a list to choose from that will come from my DB if passable. What i found which didn't do anything</p>

<p><a href="https://groups.google.com/forum/?fromgroups=#!topic/android-developers/KeUxBt4SJLw" rel="nofollow">https://groups.google.com/forum/?fromgroups=#!topic/android-developers/KeUxBt4SJLw</a></p>

<p>I want to be able to have 10 image buttons in my activity which have a spinner for each one.
And when the users pick from the spinner list a dialog will appear(which i will try later hopefully after i can code this first). </p>

<p>Any help will help thanks </p>

<pre><code>      package com.spinn;

      import android.app.Activity;
      import android.os.Bundle;
      import android.widget.ArrayAdapter;
      import android.widget.Button;
      import android.widget.Spinner;

      public class MainActivity extends Activity {

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

      ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(
      this, R.array.array_name, android.R.layout.simple_spinner_item );
      adapter.setDropDownViewResource(             
      android.R.layout.    simple_spinner_dropdown_item );

        Spinner s = (Spinner) findViewById( R.id.unique_id );
        s.setAdapter( adapter );
</code></pre>

<p>XML</p>

<pre><code>    &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" &gt;

&lt;Button
    android:id="@+id/unique_id"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="30dp"
    android:background="@drawable/c3" /&gt;

  &lt;/RelativeLayout&gt;
</code></pre>
