Good, I have a problem I want to pass the data of a radiobutton
that are in two activitys, one is called sumaActivity
and the other restaActivity
different to another activity that is called resultadoActivity
sumaActivity
public class sumaActivity extends AppCompatActivity {
TextView txtpregunta;
RadioButton rbtna,rbtnb,rbtnc,rbtnd;
Button btnatras,btnsiguiente;
RadioGroup rdgroup;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_suma);
rdgroup = (RadioGroup) findViewById(R.id.rdgroup);
txtpregunta = (TextView) findViewById(R.id.txtpregunta);
rbtna = (RadioButton) findViewById(R.id.rbtna);
rbtnb = (RadioButton) findViewById(R.id.rbtnb);
rbtnc = (RadioButton) findViewById(R.id.rbtnc);
rbtnd = (RadioButton) findViewById(R.id.rbtnd);
btnatras= (Button) findViewById(R.id.btnatras);
btnsiguiente= (Button) findViewById(R.id.btnsiguiente);
btnsiguiente.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(getApplicationContext(),restaActivity.class);
startActivity(i);
}
});
rdgroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
if (checkedId == R.id.rbtna){
}else if (checkedId == R.id.rbtnb){
}else if (checkedId == R.id.rbtnc){
}else if (checkedId == R.id.rbtnd){
}
}
});
}
restaActivity
public class restaActivity extends AppCompatActivity {
TextView txtpregunta;
RadioButton rbtna,rbtnb,rbtnc,rbtnd;
Button btnatras,btnsiguiente;
RadioGroup rdgroup;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_resta);
rdgroup = (RadioGroup) findViewById(R.id.rdgroup);
btnsiguiente = (Button) findViewById(R.id.btnsiguiente);
btnsiguiente.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(getApplicationContext(),ResultadoActivity.class);
startActivity(i);
}
});
rdgroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
if (checkedId == R.id.rbtna){
}else if (checkedId == R.id.rbtnb){
}else if (checkedId == R.id.rbtnc){
}else if (checkedId == R.id.rbtnd){
}
}
});
}
}
And my% co_of% that is empty,
What I want is that when selecting an option of resultadoActivity
of radiobutton
and an option of sumaActivity
of radiobutton
is displayed in restaActivity
what you have selected