So here is the issue. I have a radio button to select between two options. On the MainActivity.java here is what i have.
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.shiftId);
int radioSelect = radioGroup.getCheckedRadioButtonId();
RadioButton radioButton = (RadioButton) findViewById(radioSelect);
I make it part of the bundle and pass it to another activity,
bundle.putString(RADIO, radioButton.getText().toString());
On the next activity, this is how i get the radio button data,
String radio = bundle.getString(MainActivity.RADIO);
At this point what is type of radio? It is not a string and this is how I know how. I output the value of radio and get type1 which is also the name of the selected radio button,
TextView someView = (TextView)findViewById(R.id.someViewId);
someView.setText(radio);
Then i try to do this confirmation below,
if (radio == "type1") {
TextView someView = (TextView)findViewById(R.id.someViewId);
someView.setText("it is a type1 radio button");
}
else {
TextView someView = (TextView)findViewById(R.id.someViewId);
someView.setText("it is something else");
}
"It is something else" is the output here. So I am doing something wrong while I am getting radio button parameters, or while I am passing those parameters to another activity, or while i m assigning those parameters in the new activity.
What ideally I would like to do is to get Radio Button parameters, pass them properly to the next activity and depending on which radio button is selected, make some changes. But how do I determine which of those buttons are selected. The result set that i get is not an integer not a string?