Custom Spinner error in android
<p>I have 2 spinners. i am loading the spinner data from database.When i select any item in first spinner, depending on that item, the second spinner should load corresponding data.For example, if choose vegetables in first spinner then only vegetables name should come in second and if choose fruits in 1st, then fruits name should come in second.How can i pass the selected item in 1st spinner to my Customized spinner class?
I tried to pass that item, but its giving me blank in every row of second spinner.
here is my code</p>

<pre><code>   // Spinner click listener
            spinner.setOnItemSelectedListener(new OnItemSelectedListener() {

                @Override
                public void onItemSelected(AdapterView&lt;?&gt; paramAdapterView,
                        View paramView, int paramInt, long paramLong) {
                    // TODO Auto-generated method stub
                    label = paramAdapterView.getItemAtPosition(paramInt)
                            .toString();
                    deviceID = paramInt;
                    loadSpinnerData1(label);

                }
       private void loadSpinnerData1(String type) {
        // database handler
        DatabaseHandler db = new DatabaseHandler(getApplicationContext());
                 //getting the spinner item depending on what item selected in 1st spinner
                List&lt;String&gt; manuft = db.getAllManuft(type);
        spinner1.setAdapter(new MyAdapter1(OptionsActivity.this, R.layout.row, manuft,type));
    }
</code></pre>

<p>My custom spinner class</p>

<pre><code>        public class MyAdapter1 extends ArrayAdapter&lt;String&gt;{

        public MyAdapter1(Context context, int textViewResourceId, List&lt;String&gt; manuft, String type) {
            super(context, textViewResourceId, manuft);
        }

        @Override
        public View getDropDownView(int position, View convertView,ViewGroup parent) {
            return getCustomView(position, convertView, parent, label);
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            return getCustomView(position, convertView, parent, label);
        }

        public View getCustomView(int position, View convertView, ViewGroup parent, String type) {

            DatabaseHandler db = new DatabaseHandler(getApplicationContext());

            List&lt;String&gt; manuft = db.getAllManuft(type);

            LayoutInflater inflater=getLayoutInflater();
            View row=inflater.inflate(R.layout.row, parent, false);
            TextView label=(TextView)row.findViewById(R.id.device);

            for(int i=0;i&lt;manuft.size();i++){
                label.setText(manuft.get(position));
            }


            return row;
            }
        }
</code></pre>
