spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
int selectedPosition = spinner.getSelectedItemPosition();
/*
* get the category name in which the reason is selected
into
* the application
*/
}
try it .
it wor perfectly
On Thu, Jun 21, 2012 at 5:05 PM, vani reddy <[email protected]>wrote:
>
> Hi friends,
>
> How to open spinner on click of a button.
>
> I tried
> Spinner spinner =new Spinner(this);
> ArrayAdapter<String> packSizeAdapter = new ArrayAdapter<String>(
> activity, R.layout.spinner_item, productUOMS);
>
>
> packSizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
> spinner .setAdapter(packSizeAdapter);
>
>
> Button btn=new Button(this);
> btn.setOnClickListener(new View.OnClickListener() {
> @Override
> public void onClick(View v) {
> spinner .performClick();
> }
> });
>
> It is not working at all ,Is there anyting i am missing..Please reply
>
> --
> Regards,
> Vani Reddy
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
-
Thanks & Regards
Er.Aashish Kumar Jawla
(09555865084/09910783591)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en