开发者

Getting values from the spinner inside the list

I've create the android application program using list adapter that extends the list act开发者_StackOverflow社区ivity....Inside the list i am having the spinner.. how can i get the value from the spinner inside the list..tell some idea.Thanks in Advance..


try this ::

@Override
        public void onItemSelected(AdapterView<?> parent, View view,
                int position, long id) {

        String str = mSpinner.getSelectedItem().toString();
        // getting item id by this
            myId = parent.getItemAtPosition(position).toString();
        }


I am assuming you only have one spinner in the list. In that case you can get the view by id of that spinner and fetch the value. If there are more than one then you need to add different tags to them while adding them to the list (in ListAdpater) and get these views from tag and get the value.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜