1. Download our Official Android App: Forums for Android!

Accessing selected item from Spinner present in custom defined List

Discussion in 'Android Apps & Games' started by DevAtAndroid, Sep 3, 2010.

  1. DevAtAndroid

    DevAtAndroid Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Sep 3, 2010

    Sep 3, 2010
    1
    0
    5
    Senior Developer
    India
    Hi All,
    I have created one custom defined list where the each list item is having 2 images, 2 viewtext, one spinner and one edittext. I am able to manipulate every control inside list item. I am also able to get value of echs control except spinner. When I am trying to get the selected item at a paricular position, it is returning "0" every time. Where as I acn get the value of entered text in the edittext view. Why is it happening like this. Can any body help me in this regard?

    In spinner I am providing value like this
    ArrayAdapter<String> adapter = ​
    new ArrayAdapter<String>(this.getContext(),
    android.R.layout.
    simple_spinner_item, OSA_TYPE);
    adapter.setDropDownViewResource(android.R.layout.
    simple_spinner_dropdown_item);

    spinner.setAdapter(adapter);

    Can any body tell how to get the values selected in spinner?
     

    Advertisement

Share This Page

Loading...