How can i open alertdialog box on spinnerview click?
<p>i have one spinnerview. i want to open alertdialog box on spinnerview click.</p>

<p>I'm using the code below it works, but i can't add string in adapter</p>

<pre><code>sp1.setOnTouchListener(new OnTouchListener() 
{

    public boolean onTouch(View v, MotionEvent event) {
        Dialog dialog = new Dialog(Wantto.this);
        dialog.setContentView(R.layout.age);
        dialog.setTitle("Age");
        lv1=(ListView)findViewById(R.id.list1);
        lv2=(ListView)findViewById(R.id.list2);
        lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1 , lv_num));
        dialog.show();
        return false;
    }


});

sp1.setOnTouchListener(new OnTouchListener() 
{

    public boolean onTouch(View v, MotionEvent event) {
        Dialog dialog = new Dialog(Wantto.this);
        dialog.setContentView(R.layout.age);
        dialog.setTitle("Age");
        lv1=(ListView)findViewById(R.id.list1);
        lv2=(ListView)findViewById(R.id.list2);
        lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1 , lv_num));
        dialog.show();
        return false;
    }


});
sp1.setOnTouchListener(new OnTouchListener() 
{

    public boolean onTouch(View v, MotionEvent event) {
        Dialog dialog = new Dialog(Wantto.this);
        dialog.setContentView(R.layout.age);
        dialog.setTitle("Age");
        lv1=(ListView)findViewById(R.id.list1);
        lv2=(ListView)findViewById(R.id.list2);
        lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1 , lv_num));
        dialog.show();
        return false;
    }


});
</code></pre>

<p>how can i soleve it.problem comes here <code>lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item1),lv_num));</code></p>
