I'm probably missing something really obvious here. I have created a new string called str but when I try to assign a string value from strings.xml to it I am getting the error "The method getString(int) is undefined for the type String". Not sure why it thinks it is an int?
It works fine if I just set str = "my string"?
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display_clinics);
}
public void onRadioButtonClicked(View view) {
// initialize the string variable
String str;
// Is the button now checked?
boolean checked = ((RadioButton) view).isChecked();
// Check which radio button was clicked
switch (view.getId()) {
case R.id.radioCounty1:
if (checked)
str.getString(R.string.County1);
break;
case R.id.radioCounty2:
if (checked)
str.getString(R.string.County2);
break;
}