how can i send radio button value and switch case option to server using json android?

后端 未结 4 1730
忘了有多久
忘了有多久 2021-01-29 10:07

I\'m trying to make a registration form where all values are saving on the server, but i dont know how to send the radio buttons\' value and switch option buttons\' value to ser

4条回答
  •  攒了一身酷
    2021-01-29 10:57

    i gt my answer by myself just need to use that code inside button:

     public void onClick(View v) {
    
                RadioGroup rgrp=(RadioGroup)findViewById(R.id.rg);
    
                RadioButton radioButton;
    
                int selectedId = rgrp.getCheckedRadioButtonId();
    
                // find the radiobutton by returned id
                radioButton = (RadioButton) findViewById(selectedId);
    
                Toast.makeText(RegistrationForm.this,
                        radioButton.getText(), Toast.LENGTH_SHORT).show();
    

提交回复
热议问题