[android-developers] Spinner show on click of button

2012-06-21 Thread vani reddy
Hi friends, How to open spinner on click of a button. I tried Spinner spinner =new Spinner(this); ArrayAdapterString packSizeAdapter = new ArrayAdapterString( activity, R.layout.spinner_item, productUOMS); packSizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

Re: [android-developers] Spinner show on click of button

2012-06-21 Thread Justin Anderson
Are you adding your button to your view? Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, Jun 21, 2012 at 5:35 AM, vani reddy vani.reddy.bl...@gmail.comwrote: Hi friends, How to open spinner on click of a button. I tried Spinner spinner =new

Re: [android-developers] Spinner show on click of button

2012-06-21 Thread Aashish jawla
spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub int selectedPosition =

Re: [android-developers] Spinner show on click of button

2012-06-21 Thread Justin Anderson
spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub int selectedPosition =

Re: [android-developers] Spinner show on click of button

2012-06-21 Thread vani reddy
Hi yes I am adding the Button to the view,but i am not adding the spinner to the view On Thu, Jun 21, 2012 at 7:34 PM, Justin Anderson magouyaw...@gmail.comwrote: spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void

Re: [android-developers] Spinner show on click of button

2012-06-21 Thread Justin Anderson
Hi yes I am adding the Button to the view,but i am not adding the spinner to the view Pretty sure the spinner needs to be added to the view for it to work. One option you can do if you don't want to have the spinner UI is to use AlertDialog.Builder... It allows you to set an array of options