开发者

gridview in android

i have one spinner which display data from database. now i want to display data in grid view which sel开发者_运维知识库ected in spinner.

so plz give good solution for my this question.


I think you are trying to get the value selected from the spinner and display it in grid View,if so try this..

Spinner spin_type = (Spinner) findViewById(R.id.Spinner_type);
spin_type.setOnItemSelectedListener(new OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> arg0, View arg1,
                int arg2, long arg3) {
            // TODO Auto-generated method stub
            String selected Value=array_type[arg2].toString();
        }

        @Override
        public void onNothingSelected(AdapterView<?> arg0) {
            // TODO Auto-generated method stub
        }
    });

Where array_type your String array that is having complete "DATA"..

You will get the Value selected in the Spinner in "Selected Value"..

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜