1. AC Question's Avatar
    i want user to select from all spinners validation

    @override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.specifications);

    spinner = (Spinner)findViewById(R.id.spinner);
    ArrayAdapter adapter = ArrayAdapter.createFromResource(this,R.array.processor,android.R.layout.simple_spinner_item);
    spinner.setAdapter(adapter);
    //spinner.setOnItemClickListener((AdapterView.OnItemClickListener) this);
    spinner.setOnItemSelectedListener(this);

    /*if (spinner.isSelected()) {
    pprices();
    }*/

    spinner2 = (Spinner)findViewById(R.id.spinner2);
    ArrayAdapter adapter1 = ArrayAdapter.createFromResource(this,R.array.hard1,android.R.layout.simple_spinner_item);
    spinner2.setAdapter(adapter1);
    //spinner.setOnItemClickListener((AdapterView.OnItemClickListener) this);
    spinner2.setOnItemSelectedListener(this);

    /*if(spinner2.isSelected()){
    hprices();
    }*/

    spinner3 = (Spinner)findViewById(R.id.spinner3);
    ArrayAdapter adapter2 = ArrayAdapter.createFromResource(this,R.array.ram,android.R.layout.simple_spinner_item);
    spinner3.setAdapter(adapter2);
    //spinner.setOnItemClickListener((AdapterView.OnItemClickListener) this);
    spinner3.setOnItemSelectedListener(this);

    /*if(spinner3.isSelected())
    {
    rprices();
    }*/

    spinner4 = (Spinner)findViewById(R.id.spinner4);
    ArrayAdapter adapter3 = ArrayAdapter.createFromResource(this,R.array.screen,android.R.layout.simple_spinner_item);
    spinner4.setAdapter(adapter3);
    //spinner.setOnItemClickListener((AdapterView.OnItemClickListener) this);
    spinner4.setOnItemSelectedListener(this);

    /*if(spinner4.isSelected())
    {
    sprices();
    }*/

    spinner5 = (Spinner)findViewById(R.id.spinner5);
    ArrayAdapter adapter4 = ArrayAdapter.createFromResource(this,R.array.condition,android.R.layout.simple_spinner_item);
    spinner5.setAdapter(adapter4);
    //spinner.setOnItemClickListener((AdapterView.OnItemClickListener) this);
    spinner5.setOnItemSelectedListener(this);

    /*if (spinner5.isSelected())
    {
    cprices();
    }*/

    spinner6 = (Spinner)findViewById(R.id.spinner6);
    ArrayAdapter adapter5 = ArrayAdapter.createFromResource(this,R.array.age,android.R.layout.simple_spinner_item);
    spinner6.setAdapter(adapter5);
    //spinner.setOnItemClickListener((AdapterView.OnItemClickListener) this);
    spinner6.setOnItemSelectedListener(this);

    /*if(spinner6.isSelected())
    {
    aprices();
    }*/
    b=(Button)findViewById(R.id.specific);

    b.setOnClickListener(new View.OnClickListener() {
    @override
    public void onClick(View v) {
    i=new Intent(specifications.this,faultyparts.class);
    startActivity(i);

    }
    });

    }
    03-12-2017 12:43 PM
  2. B. Diddy's Avatar
    Moved to the Software Development forum.
    03-17-2017 01:40 PM

Similar Threads

  1. Blu Life XL with Lollipop Apps to SD card
    By AC Question in forum Ask a Question
    Replies: 3
    Last Post: 03-13-2017, 12:59 PM
  2. How to change standby mode
    By AC Question in forum Samsung Galaxy S6
    Replies: 1
    Last Post: 03-13-2017, 02:16 AM
  3. adding a short cut to home screen
    By ep1 in forum Ask a Question
    Replies: 1
    Last Post: 03-12-2017, 08:04 PM
  4. I need some helpkeeping my phone from changing volumes on its own please
    By AC Question in forum Samsung Galaxy S7 edge
    Replies: 4
    Last Post: 03-12-2017, 02:49 PM
  5. How to change standby mode
    By AC Question in forum Ask a Question
    Replies: 0
    Last Post: 03-12-2017, 11:13 AM
LINK TO POST COPIED TO CLIPBOARD